TransactionTTL { public static long toMs(long themisTs) { return themisTs >> 18; }  static void init(Configuration conf); static long toMs(long themisTs); static long toChronsTs(long ms); static long getExpiredTimestampForReadByCommitColumn(long currentMs); static long getExpiredTimestampForReadByDataColumn(long currentMs); static long getExpiredTimestampForWrite(long currentMs); static boolean isLockExpired(long lockTs, long clientLockTTL); static final String THEMIS_TRANSACTION_TTL_ENABLE_KEY; static final String THEMIS_READ_TRANSACTION_TTL_KEY; static final int DEFAULT_THEMIS_READ_TRANSACTION_TTL; static final String THEMIS_WRITE_TRANSACTION_TTL_KEY; static final int DEFAULT_THEMIS_WRITE_TRANSACTION_TTL; static final String THEMIS_TRANSACTION_TTL_TIME_ERROR_KEY; static final int DEFAULT_THEMIS_TRANSACTION_TTL_TIME_ERROR; static int readTransactionTTL; static int writeTransactionTTL; static int transactionTTLTimeError; static TimestampType timestampType; static boolean transactionTTLEnable; }
@Test public void testToMs() throws IOException { TransactionTTL.init(HBaseConfiguration.create()); long ms = TransactionTTL.toMs(369778447744761856l); Assert.assertTrue(ms < System.currentTimeMillis()); Assert.assertTrue(ms > (System.currentTimeMillis() - 5l * 365 * 24 * 3600 * 1000)); }