ThemisCpUtil { public static void addLockAndWriteColumnToScan(Column column, Scan scan) { if (!(scan.getFamilyMap().containsKey(ColumnUtil.LOCK_FAMILY_NAME) && scan .getFamilyMap().get(ColumnUtil.LOCK_FAMILY_NAME) == null)) { Column lockColumn = ColumnUtil.getLockColumn(column); scan.addColumn(lockColumn.getFamily(), lockColumn.getQualifier()); } Column putColumn = ColumnUtil.getPutColumn(column); if (ColumnUtil.isCommitToSameFamily() || !(scan.getFamilyMap().containsKey(ColumnUtil.PUT_FAMILY_NAME_BYTES) && scan .getFamilyMap().get(ColumnUtil.PUT_FAMILY_NAME_BYTES) == null)) { scan.addColumn(putColumn.getFamily(), putColumn.getQualifier()); } Column deleteColumn = ColumnUtil.getDeleteColumn(column); if (ColumnUtil.isCommitToSameFamily() || !(scan.getFamilyMap().containsKey(ColumnUtil.DELETE_FAMILY_NAME_BYTES) && scan .getFamilyMap().get(ColumnUtil.DELETE_FAMILY_NAME_BYTES) == null)) { scan.addColumn(deleteColumn.getFamily(), deleteColumn.getQualifier()); } }  static String getDisallowedFilterClassNameString(); static void processFilters(Filter filter, FilterCallable callable); static void moveRowkeyFiltersForWriteGet(Get sourceGet, Get destGet); static void moveRowkeyFiltersForWriteScan(Scan sourceScan, Scan destScan); static void addLockAndWriteColumnToGet(Get userGet, Get internalGet, long startTs); static Result removeNotRequiredLockColumns(Map<byte[], NavigableSet<byte[]>> familyMap,
      Result result); static Get constructLockAndWriteGet(Get userGet, long startTs); static void prepareGet(Get get, Collection<HColumnDescriptor> families); static void prepareScan(Scan scan, Collection<HColumnDescriptor> families); static Scan constructLockAndWriteScan(Scan userScan, long startTs); static void addLockAndWriteColumnToScan(Column column, Scan scan); static Get constructDataGetByPutKvs(List<KeyValue> putKvs, Filter filter); static void addWriteColumnToGet(Column column, Get get); static boolean isLockResult(Result result); static Pair<List<KeyValue>, List<KeyValue>> seperateLockAndWriteKvs(List<KeyValue> kvs); static Set<Class<? extends Filter>> ALLOWED_ROWKEY_FILTER_CLASSES; static Set<Class<? extends Filter>> DISALLOWD_FILTERS; }
@Test public void testAddLockAndWriteColumnToScan() { Scan scan = new Scan(); ThemisCpUtil.addLockAndWriteColumnToScan(COLUMN, scan); checkReadWithLockAndWriteColumns(scan.getFamilyMap(), COLUMN); scan = new Scan(); scan.addFamily(ColumnUtil.LOCK_FAMILY_NAME); ThemisCpUtil.addLockAndWriteColumnToScan(COLUMN, scan); Assert.assertTrue(scan.getFamilyMap().containsKey(ColumnUtil.LOCK_FAMILY_NAME) && scan.getFamilyMap().get(ColumnUtil.LOCK_FAMILY_NAME) == null); checkReadWithWriteColumns(scan.getFamilyMap(), COLUMN); }