ThemisCpUtil { public static Get constructDataGetByPutKvs(List<KeyValue> putKvs, Filter filter) throws IOException { Get get = new Get(putKvs.get(0).getRow()); long minTs = Long.MAX_VALUE; long maxTs = 0; ColumnTimestampFilter timestampFilter = new ColumnTimestampFilter(); for (int i = 0; i < putKvs.size(); ++i) { KeyValue putKv = putKvs.get(i); Column putColumn = new Column(putKv.getFamily(), putKv.getQualifier()); Column dataColumn = ColumnUtil.getDataColumn(putColumn); get.addColumn(dataColumn.getFamily(), dataColumn.getQualifier()); long prewriteTs = Bytes.toLong(putKv.getValue()); timestampFilter.addColumnTimestamp(dataColumn, prewriteTs); if (minTs > prewriteTs) { minTs = prewriteTs; } if (maxTs < prewriteTs) { maxTs = prewriteTs; } } get.setTimeRange(minTs, maxTs + 1); if (filter == null) { get.setFilter(timestampFilter); } else { FilterList filterList = new FilterList(); filterList.addFilter(timestampFilter); filterList.addFilter(filter); get.setFilter(filterList); } return get; }  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 testConstructDataGetByWriteColumnKvs() throws IOException { List<KeyValue> putKvs = new ArrayList<KeyValue>(); putKvs.add(getPutKv(COLUMN, PREWRITE_TS, COMMIT_TS)); putKvs.add(getPutKv(COLUMN_WITH_ANOTHER_FAMILY, PREWRITE_TS + 10 , COMMIT_TS + 10)); Get get = ThemisCpUtil.constructDataGetByPutKvs(putKvs, null); checkConstructedDataGet(putKvs, null, get); Filter filter = new SingleColumnValueFilter(); get = ThemisCpUtil.constructDataGetByPutKvs(putKvs, filter); checkConstructedDataGet(putKvs, filter, get); }