@Test public void testHasLock() throws IOException { ThemisLock lc = getLock(COLUMN); Assert.assertFalse(lockCleaner.hasLock(lc)); writeLockAndData(COLUMN); Assert.assertTrue(lockCleaner.hasLock(lc)); }
protected boolean hasLock(ThemisLock lock) throws IOException { ColumnCoordinate columnCoordinate = lock.getColumn(); Column lc = ColumnUtil.getLockColumn(columnCoordinate); HTableInterface table = null; try { table = conn.getTable(columnCoordinate.getTableName()); Get get = new Get(columnCoordinate.getRow()).addColumn(lc.getFamily(), lc.getQualifier()); get.setTimeStamp(lock.getTimestamp()); return !table.get(get).isEmpty(); } finally { closeTable(table); } }
LockCleaner extends ServerLockCleaner { protected boolean hasLock(ThemisLock lock) throws IOException { ColumnCoordinate columnCoordinate = lock.getColumn(); Column lc = ColumnUtil.getLockColumn(columnCoordinate); HTableInterface table = null; try { table = conn.getTable(columnCoordinate.getTableName()); Get get = new Get(columnCoordinate.getRow()).addColumn(lc.getFamily(), lc.getQualifier()); get.setTimeStamp(lock.getTimestamp()); return !table.get(get).isEmpty(); } finally { closeTable(table); } } }
LockCleaner extends ServerLockCleaner { protected boolean hasLock(ThemisLock lock) throws IOException { ColumnCoordinate columnCoordinate = lock.getColumn(); Column lc = ColumnUtil.getLockColumn(columnCoordinate); HTableInterface table = null; try { table = conn.getTable(columnCoordinate.getTableName()); Get get = new Get(columnCoordinate.getRow()).addColumn(lc.getFamily(), lc.getQualifier()); get.setTimeStamp(lock.getTimestamp()); return !table.get(get).isEmpty(); } finally { closeTable(table); } } LockCleaner(Configuration conf, HConnection conn, WorkerRegister register,
      ThemisCoprocessorClient cpClient); }
LockCleaner extends ServerLockCleaner { protected boolean hasLock(ThemisLock lock) throws IOException { ColumnCoordinate columnCoordinate = lock.getColumn(); Column lc = ColumnUtil.getLockColumn(columnCoordinate); HTableInterface table = null; try { table = conn.getTable(columnCoordinate.getTableName()); Get get = new Get(columnCoordinate.getRow()).addColumn(lc.getFamily(), lc.getQualifier()); get.setTimeStamp(lock.getTimestamp()); return !table.get(get).isEmpty(); } finally { closeTable(table); } } LockCleaner(Configuration conf, HConnection conn, WorkerRegister register,
      ThemisCoprocessorClient cpClient); static LockCleaner getLockCleaner(Configuration conf, HConnection conn,
      WorkerRegister register, ThemisCoprocessorClient cpClient); boolean shouldCleanLock(ThemisLock lock); static List<ThemisLock> constructLocks(byte[] tableName, List<KeyValue> lockKvs,
      ThemisCoprocessorClient cpClient, int clientLockTTL); static void checkLockExpired(ThemisLock lock, ThemisCoprocessorClient cpClient,
      int clientLockTTL); void tryToCleanLocks(byte[] tableName, List<KeyValue> lockColumns); boolean checkLockExpiredAndTryToCleanLock(ThemisLock lock); boolean tryToCleanLock(ThemisLock lock); }
LockCleaner extends ServerLockCleaner { protected boolean hasLock(ThemisLock lock) throws IOException { ColumnCoordinate columnCoordinate = lock.getColumn(); Column lc = ColumnUtil.getLockColumn(columnCoordinate); HTableInterface table = null; try { table = conn.getTable(columnCoordinate.getTableName()); Get get = new Get(columnCoordinate.getRow()).addColumn(lc.getFamily(), lc.getQualifier()); get.setTimeStamp(lock.getTimestamp()); return !table.get(get).isEmpty(); } finally { closeTable(table); } } LockCleaner(Configuration conf, HConnection conn, WorkerRegister register,
      ThemisCoprocessorClient cpClient); static LockCleaner getLockCleaner(Configuration conf, HConnection conn,
      WorkerRegister register, ThemisCoprocessorClient cpClient); boolean shouldCleanLock(ThemisLock lock); static List<ThemisLock> constructLocks(byte[] tableName, List<KeyValue> lockKvs,
      ThemisCoprocessorClient cpClient, int clientLockTTL); static void checkLockExpired(ThemisLock lock, ThemisCoprocessorClient cpClient,
      int clientLockTTL); void tryToCleanLocks(byte[] tableName, List<KeyValue> lockColumns); boolean checkLockExpiredAndTryToCleanLock(ThemisLock lock); boolean tryToCleanLock(ThemisLock lock);  }