@Override public void init(TransactionManager resource) { try { resource.getKeyValueService().dropTables(deprecatedTables); log.info("Successfully dropped deprecated tables on startup."); } catch (Throwable e) { log.info("Could not drop deprecated tables from the underlying KeyValueService.", e); } }
public static Map<String, Object> execute(TransactionManager txnManager, int numClients, int requestsPerClient) { txnManager.getKeyValueService().createTable(TABLE, AtlasDbConstants.GENERIC_TABLE_METADATA); return new KvsWriteBenchmark(txnManager.getKeyValueService(), numClients, requestsPerClient).execute(); }
public static Map<String, Object> execute(TransactionManager txnManager, int numClients, int requestsPerClient) { return new KvsPutUnlessExistsBenchmark(txnManager.getKeyValueService(), numClients, requestsPerClient) .execute(); }
public static Map<String, Object> execute(TransactionManager txnManager, int numClients, int requestsPerClient) { return new KvsReadBenchmark(txnManager.getKeyValueService(), numClients, requestsPerClient).execute(); }
public void initializeWithoutRunning(TransactionManager txManager) { initializeWithoutRunning(SpecialTimestampsSupplier.create(txManager), txManager.getTimelockService(), txManager.getKeyValueService(), TransactionServices.createTransactionService(txManager.getKeyValueService(), CoordinationServices.createDefault( txManager.getKeyValueService(), txManager.getTimestampService(), false)), new TargetedSweepFollower(followers, txManager)); }
@Override public boolean doTransactionAndReportOutcome() { try { return transactionManager.runTaskThrowOnConflict(tx -> { KeyValueService kvs = transactionManager.getKeyValueService(); kvs.createTable(TEST_TABLE, AtlasDbConstants.GENERIC_TABLE_METADATA); tx.put(TEST_TABLE, ImmutableMap.of(TEST_CELL, new byte[1])); return true; }); } catch (Exception e) { return false; } }
private TargetedSweeper initializeAndGet(TargetedSweeper sweeper, TransactionManager txManager) { sweeper.initializeWithoutRunning( new SpecialTimestampsSupplier(txManager::getImmutableTimestamp, txManager::getImmutableTimestamp), txManager.getTimelockService(), txManager.getKeyValueService(), TransactionServices.createForTesting( txManager.getKeyValueService(), txManager.getTimestampService(), false), new TargetedSweepFollower(ImmutableList.of(FOLLOWER), txManager)); sweeper.runInBackground(); return sweeper; }
@Override protected void cleanup() { txnManager.getKeyValueService().truncateTable(tableFactory.getBlobsSerializableTable(null).getTableRef()); }
@Before public void setUp() { when(transactionManager.getKeyValueService()).thenReturn(keyValueService); }
public static CoordinationResource create(TransactionManager transactionManager) { return new SimpleCoordinationResource(transactionManager, new TransactionSchemaManager( CoordinationServices.createDefault( transactionManager.getKeyValueService(), transactionManager.getTimestampService(), false))); }
private boolean isInitializedInternal() { // Note that the PersistentLockService is also initialized asynchronously as part of // TransactionManagers.create; however, this is not required for the TransactionManager to fulfil // requests (note that it is not accessible from any TransactionManager implementation), so we omit // checking here whether it is initialized. return txManager.getKeyValueService().isInitialized() && txManager.getTimelockService().isInitialized() && txManager.getTimestampService().isInitialized() && txManager.getCleaner().isInitialized() && initializationPrerequisite.get(); }
@Override public long resetStateAndGetFreshTimestamp() { forceInstallNewTransactionsSchemaVersion(1); KeyValueService kvs = transactionManager.getKeyValueService(); kvs.truncateTable(AtlasDbConstants.COORDINATION_TABLE); kvs.createTable(TEST_TABLE, AtlasDbConstants.GENERIC_TABLE_METADATA); kvs.truncateTable(TEST_TABLE); return timestampService.getFreshTimestamp(); }
private SweepTaskRunner getSweepTaskRunner( TransactionManager transactionManager, MetricRegistry metricRegistry, TaggedMetricRegistry taggedMetricRegistry) { KeyValueService kvs = transactionManager.getKeyValueService(); LongSupplier ts = transactionManager.getTimestampService()::getFreshTimestamp; TransactionService txnService = TransactionServices.createForTesting(kvs, transactionManager.getTimestampService(), false); SweepStrategyManager ssm = SweepStrategyManagers.completelyConservative(kvs); // maybe createDefault PersistentLockManager noLocks = new PersistentLockManager( MetricsManagers.of(metricRegistry, taggedMetricRegistry), new NoOpPersistentLockService(), AtlasDbConstants.DEFAULT_SWEEP_PERSISTENT_LOCK_WAIT_MILLIS); CleanupFollower follower = CleanupFollower.create(ETE_SCHEMAS); CellsSweeper cellsSweeper = new CellsSweeper(transactionManager, kvs, noLocks, ImmutableList.of(follower)); return new SweepTaskRunner(kvs, ts, ts, txnService, ssm, cellsSweeper); }
@Override public void init(TransactionManager resource) { try { resource.getKeyValueService().dropTables(deprecatedTables); log.info("Successfully dropped deprecated tables on startup."); } catch (Throwable e) { log.info("Could not drop deprecated tables from the underlying KeyValueService.", e); } }
public void initializeWithoutRunning(TransactionManager txManager) { initializeWithoutRunning(SpecialTimestampsSupplier.create(txManager), txManager.getTimelockService(), txManager.getKeyValueService(), TransactionServices.createTransactionService(txManager.getKeyValueService(), CoordinationServices.createDefault( txManager.getKeyValueService(), txManager.getTimestampService(), false)), new TargetedSweepFollower(followers, txManager)); }
private boolean isInitializedInternal() { // Note that the PersistentLockService is also initialized asynchronously as part of // TransactionManagers.create; however, this is not required for the TransactionManager to fulfil // requests (note that it is not accessible from any TransactionManager implementation), so we omit // checking here whether it is initialized. return txManager.getKeyValueService().isInitialized() && txManager.getTimelockService().isInitialized() && txManager.getTimestampService().isInitialized() && txManager.getCleaner().isInitialized() && initializationPrerequisite.get(); }