class ThemisCpUtil {

  public static void addLockAndWriteColumnToGet(Get userGet, Get internalGet, long startTs)
      throws IOException {
    boolean excludeDataColumn = false;
    for (Entry<byte[], NavigableSet<byte[]>> entry : userGet.getFamilyMap().entrySet()) {
      if (entry.getValue() != null && entry.getValue().size() > 0) {
        for (byte[] qualifier : entry.getValue()) {
          Column dataColumn = new Column(entry.getKey(), qualifier);
          // not include the whole lock family
          if (!(internalGet.getFamilyMap().containsKey(ColumnUtil.LOCK_FAMILY_NAME) && internalGet
              .getFamilyMap().get(ColumnUtil.LOCK_FAMILY_NAME) == null)) {
            Column lockColumn = ColumnUtil.getLockColumn(dataColumn);
            internalGet.addColumn(lockColumn.getFamily(), lockColumn.getQualifier());
          }
          addWriteColumnToGet(dataColumn, internalGet);
        }
      } else {
        // TODO : use filter to read out lock columns corresponding to needed data column
        internalGet.addFamily(ColumnUtil.LOCK_FAMILY_NAME);
        if (ColumnUtil.isCommitToSameFamily()) {
          internalGet.addFamily(entry.getKey());
        } else {
          internalGet.addFamily(ColumnUtil.PUT_FAMILY_NAME_BYTES);
          internalGet.addFamily(ColumnUtil.DELETE_FAMILY_NAME_BYTES);
        }
        excludeDataColumn = true;
      }
    }
    if (excludeDataColumn) {
      internalGet.setFilter(new ExcludeDataColumnFilter());
    }
    internalGet.setTimeRange(0, startTs);
  }

}