ServerLockCleaner { public Long getTimestampOfWriteIndexingPrewriteTs(ColumnCoordinate columnCoordinate, long timestamp) throws IOException { HTableInterface table = null; try { table = conn.getTable(columnCoordinate.getTableName()); Get get = createGetOfWriteColumnsIndexingPrewriteTs(columnCoordinate, timestamp); Result result = conn.getTable(columnCoordinate.getTableName()).get(get); if (result.list() != null) { for (KeyValue kv : result.list()) { long prewriteTs = Bytes.toLong(kv.getValue()); if (prewriteTs == timestamp) { return kv.getTimestamp(); } } } return null; } finally { closeTable(table); } } ServerLockCleaner(HConnection conn, ThemisCoprocessorClient cpClient); static PrimaryLock getPrimaryLockWithColumn(ThemisLock lock); void cleanLock(ThemisLock lock); Pair<Long, PrimaryLock> cleanPrimaryLock(ColumnCoordinate columnCoordinate,
      long prewriteTs); Long getTimestampOfWriteIndexingPrewriteTs(ColumnCoordinate columnCoordinate, long timestamp); Get createGetOfWriteColumnsIndexingPrewriteTs(ColumnCoordinate columnCoordinate, long timestamp); void cleanSecondaryLocks(PrimaryLock primaryLock, Long commitTs); void eraseLockAndData(ColumnCoordinate column, long timestamp); void eraseLockAndData(byte[] tableName, byte[] row, Collection<Column> columns, long timestamp);  }
@Test public void testGetTimestampOfWriteIndexingPrewriteTs() throws IOException { Assert.assertNull(lockCleaner.getTimestampOfWriteIndexingPrewriteTs(COLUMN, prewriteTs)); writePutColumn(COLUMN, prewriteTs - 1, commitTs - 1); writePutColumn(COLUMN, prewriteTs + 1, commitTs + 1); writeDeleteColumn(COLUMN, prewriteTs + 2, commitTs + 2); Assert.assertNull(lockCleaner.getTimestampOfWriteIndexingPrewriteTs(COLUMN, prewriteTs)); writePutColumn(COLUMN, prewriteTs, commitTs); Long ts = lockCleaner.getTimestampOfWriteIndexingPrewriteTs(COLUMN, prewriteTs); Assert.assertEquals(commitTs, ts.longValue()); ts = lockCleaner.getTimestampOfWriteIndexingPrewriteTs(COLUMN, prewriteTs + 2); Assert.assertEquals(commitTs + 2, ts.longValue()); }