class 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;
      }
    }
    // minTs and maxTs should be updated to contain all the prewriteTs which needs to be read
    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;
  }

}