use of com.palantir.timestamp.InMemoryTimestampService in project atlasdb by palantir.
the class AbstractSweepTest method setup.
@Before
public void setup() {
TimestampService tsService = new InMemoryTimestampService();
kvs = SweepStatsKeyValueService.create(getKeyValueService(), tsService, () -> AtlasDbConstants.DEFAULT_SWEEP_WRITE_THRESHOLD, () -> AtlasDbConstants.DEFAULT_SWEEP_WRITE_SIZE_THRESHOLD);
ssm = SweepStrategyManagers.createDefault(kvs);
txService = TransactionServices.createTransactionService(kvs);
txManager = SweepTestUtils.setupTxManager(kvs, tsService, ssm, txService);
persistentLockManager = new PersistentLockManager(SweepTestUtils.getPersistentLockService(kvs), AtlasDbConstants.DEFAULT_SWEEP_PERSISTENT_LOCK_WAIT_MILLIS);
InMemorySweepQueue.clear();
}
use of com.palantir.timestamp.InMemoryTimestampService in project atlasdb by palantir.
the class AtlasDbTestCase method setUp.
@Before
public void setUp() throws Exception {
timestampService = new InMemoryTimestampService();
KeyValueService kvs = getBaseKeyValueService();
keyValueServiceWithStats = new StatsTrackingKeyValueService(kvs);
keyValueService = new TrackingKeyValueService(keyValueServiceWithStats);
TransactionTables.createTables(kvs);
transactionService = TransactionServices.createTransactionService(kvs);
conflictDetectionManager = ConflictDetectionManagers.createWithoutWarmingCache(keyValueService);
sweepStrategyManager = SweepStrategyManagers.createDefault(keyValueService);
serializableTxManager = new TestTransactionManagerImpl(keyValueService, timestampService, lockClient, lockService, transactionService, conflictDetectionManager, sweepStrategyManager, wrappingSweepQueue);
txManager = new CachingTestTransactionManager(serializableTxManager);
}
use of com.palantir.timestamp.InMemoryTimestampService in project atlasdb by palantir.
the class TransactionTestSetup method setUp.
@Before
public void setUp() throws Exception {
lockService = LockServiceImpl.create(LockServerOptions.builder().isStandaloneServer(false).build());
lockClient = LockClient.of("test_client");
keyValueService = getKeyValueService();
keyValueService.createTables(ImmutableMap.of(TEST_TABLE_THOROUGH, new TableMetadata(new NameMetadataDescription(), new ColumnMetadataDescription(), ConflictHandler.RETRY_ON_WRITE_WRITE, TableMetadataPersistence.CachePriority.WARM, true, 4, true, TableMetadataPersistence.SweepStrategy.THOROUGH, false, TableMetadataPersistence.LogSafety.UNSAFE).persistToBytes(), TEST_TABLE, new TableMetadata(new NameMetadataDescription(), new ColumnMetadataDescription(), ConflictHandler.RETRY_ON_WRITE_WRITE, TableMetadataPersistence.CachePriority.WARM, true, 4, true, TableMetadataPersistence.SweepStrategy.NOTHING, false, TableMetadataPersistence.LogSafety.UNSAFE).persistToBytes(), TransactionConstants.TRANSACTION_TABLE, TransactionConstants.TRANSACTION_TABLE_METADATA.persistToBytes()));
keyValueService.truncateTables(ImmutableSet.of(TEST_TABLE, TransactionConstants.TRANSACTION_TABLE));
timestampService = new InMemoryTimestampService();
transactionService = TransactionServices.createTransactionService(keyValueService);
conflictDetectionManager = ConflictDetectionManagers.createWithoutWarmingCache(keyValueService);
sweepStrategyManager = SweepStrategyManagers.createDefault(keyValueService);
txMgr = getManager();
}
use of com.palantir.timestamp.InMemoryTimestampService in project atlasdb by palantir.
the class KeyValueServiceMigratorsTest method createMockAtlasDbServices.
private static AtlasDbServices createMockAtlasDbServices() {
TimestampService timestampService = new InMemoryTimestampService();
AtlasDbServices mockServices = mock(AtlasDbServices.class);
when(mockServices.getTimestampService()).thenReturn(timestampService);
when(mockServices.getTransactionService()).thenReturn(mock(TransactionService.class));
return mockServices;
}
Aggregations