Search in sources :

Example 6 with InMemoryTimestampService

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();
}
Also used : InMemoryTimestampService(com.palantir.timestamp.InMemoryTimestampService) InMemoryTimestampService(com.palantir.timestamp.InMemoryTimestampService) TimestampService(com.palantir.timestamp.TimestampService) Before(org.junit.Before)

Example 7 with InMemoryTimestampService

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);
}
Also used : InMemoryKeyValueService(com.palantir.atlasdb.keyvalue.impl.InMemoryKeyValueService) StatsTrackingKeyValueService(com.palantir.atlasdb.keyvalue.impl.StatsTrackingKeyValueService) TracingKeyValueService(com.palantir.atlasdb.keyvalue.impl.TracingKeyValueService) TrackingKeyValueService(com.palantir.atlasdb.keyvalue.impl.TrackingKeyValueService) KeyValueService(com.palantir.atlasdb.keyvalue.api.KeyValueService) StatsTrackingKeyValueService(com.palantir.atlasdb.keyvalue.impl.StatsTrackingKeyValueService) TestTransactionManagerImpl(com.palantir.atlasdb.transaction.impl.TestTransactionManagerImpl) StatsTrackingKeyValueService(com.palantir.atlasdb.keyvalue.impl.StatsTrackingKeyValueService) TrackingKeyValueService(com.palantir.atlasdb.keyvalue.impl.TrackingKeyValueService) CachingTestTransactionManager(com.palantir.atlasdb.transaction.impl.CachingTestTransactionManager) InMemoryTimestampService(com.palantir.timestamp.InMemoryTimestampService) Before(org.junit.Before)

Example 8 with InMemoryTimestampService

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();
}
Also used : TableMetadata(com.palantir.atlasdb.table.description.TableMetadata) NameMetadataDescription(com.palantir.atlasdb.table.description.NameMetadataDescription) ColumnMetadataDescription(com.palantir.atlasdb.table.description.ColumnMetadataDescription) InMemoryTimestampService(com.palantir.timestamp.InMemoryTimestampService) Before(org.junit.Before)

Example 9 with InMemoryTimestampService

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;
}
Also used : TransactionService(com.palantir.atlasdb.transaction.service.TransactionService) InMemoryTimestampService(com.palantir.timestamp.InMemoryTimestampService) AtlasDbServices(com.palantir.atlasdb.services.AtlasDbServices) InMemoryTimestampService(com.palantir.timestamp.InMemoryTimestampService) TimestampService(com.palantir.timestamp.TimestampService)

Aggregations

InMemoryTimestampService (com.palantir.timestamp.InMemoryTimestampService)9 Before (org.junit.Before)6 TimestampService (com.palantir.timestamp.TimestampService)5 SweepStrategyManager (com.palantir.atlasdb.transaction.impl.SweepStrategyManager)3 TransactionService (com.palantir.atlasdb.transaction.service.TransactionService)3 Cleaner (com.palantir.atlasdb.cleaner.Cleaner)2 KeyValueService (com.palantir.atlasdb.keyvalue.api.KeyValueService)2 InMemoryKeyValueService (com.palantir.atlasdb.keyvalue.impl.InMemoryKeyValueService)2 ConflictDetectionManager (com.palantir.atlasdb.transaction.impl.ConflictDetectionManager)2 SerializableTransactionManager (com.palantir.atlasdb.transaction.impl.SerializableTransactionManager)2 LockClient (com.palantir.lock.LockClient)2 LockService (com.palantir.lock.LockService)2 CleanupFollower (com.palantir.atlasdb.cleaner.CleanupFollower)1 DefaultCleanerBuilder (com.palantir.atlasdb.cleaner.DefaultCleanerBuilder)1 NoOpCleaner (com.palantir.atlasdb.cleaner.NoOpCleaner)1 StatsTrackingKeyValueService (com.palantir.atlasdb.keyvalue.impl.StatsTrackingKeyValueService)1 TracingKeyValueService (com.palantir.atlasdb.keyvalue.impl.TracingKeyValueService)1 TrackingKeyValueService (com.palantir.atlasdb.keyvalue.impl.TrackingKeyValueService)1 AtlasDbServices (com.palantir.atlasdb.services.AtlasDbServices)1 SweepMetricsManager (com.palantir.atlasdb.sweep.metrics.SweepMetricsManager)1