@Test public void testSnapshotPersistence() throws Exception { Configuration conf = getConfiguration("testSnapshotPersistence"); TransactionSnapshot snapshot = createRandomSnapshot(); TransactionStateStorage storage = getStorage(conf); try { storage.startAndWait(); storage.writeSnapshot(snapshot); TransactionSnapshot readSnapshot = storage.getLatestSnapshot(); assertNotNull(readSnapshot); assertEquals(snapshot, readSnapshot); } finally { storage.stopAndWait(); } }
committing.put(readPointer + i, generateChangeSet(10)); NavigableMap<Long, Set<ChangeId>> committed = Maps.newTreeMap(); for (int i = 0; i < 1000; i++) { committed.put(startCommitted + i, generateChangeSet(10));
@Test public void testLogWriteAndRead() throws Exception { Configuration conf = getConfiguration("testLogWriteAndRead"); TransactionStateStorage storage = getStorage(conf); try { long now = System.currentTimeMillis();
Configuration conf = getConfiguration("testCommittedSetClearing"); conf.setInt(TxConstants.Manager.CFG_TX_CLEANUP_INTERVAL, 0); // no cleanup thread conf.setInt(TxConstants.Manager.CFG_TX_SNAPSHOT_INTERVAL, 0); // no periodic snapshots TransactionStateStorage storage2 = null; try { storage1 = getStorage(conf); TransactionManager txManager = new TransactionManager (conf, storage1, new TxMetricsCollector()); storage2 = getStorage(conf); txManager = new TransactionManager(conf, storage2, new TxMetricsCollector()); txManager.startAndWait();
Configuration conf = getConfiguration("testOldFileRemoval"); TransactionStateStorage storage = null; try { storage = getStorage(conf); storage.startAndWait(); long now = System.currentTimeMillis();
@Test public void testLongTxnEditReplay() throws Exception { Configuration conf = getConfiguration("testLongTxnEditReplay"); TransactionStateStorage storage = null; try { storage = getStorage(conf); storage.startAndWait();
@Test public void testTruncateInvalidTxEditReplay() throws Exception { Configuration conf = getConfiguration("testTruncateInvalidTxEditReplay"); TransactionStateStorage storage = null; try { storage = getStorage(conf); storage.startAndWait();
@Test public void testTransactionManagerPersistence() throws Exception { Configuration conf = getConfiguration("testTransactionManagerPersistence"); conf.setInt(TxConstants.Manager.CFG_TX_CLEANUP_INTERVAL, 0); // no cleanup thread TransactionStateStorage storage3 = null; try { storage = getStorage(conf); TransactionManager txManager = new TransactionManager (conf, storage, new TxMetricsCollector()); storage2 = getStorage(conf); txManager = new TransactionManager(conf, storage2, new TxMetricsCollector()); txManager.startAndWait(); storage3 = getStorage(conf); txManager = new TransactionManager(conf, storage3, new TxMetricsCollector()); txManager.startAndWait();