Search in sources :

Example 1 with SpecialTimestampsSupplier

use of com.palantir.atlasdb.sweep.queue.SpecialTimestampsSupplier in project atlasdb by palantir.

the class AtlasDbEteServer method initializeAndGet.

private TargetedSweeper initializeAndGet(TargetedSweeper sweeper, TransactionManager txManager) {
    // Intentionally providing the immutable timestamp instead of unreadable to avoid the delay
    sweeper.initializeWithoutRunning(new SpecialTimestampsSupplier(txManager::getImmutableTimestamp, txManager::getImmutableTimestamp), txManager.getTimelockService(), txManager.getKeyValueService(), TransactionServices.createRaw(txManager.getKeyValueService(), txManager.getTimestampService(), false), new TargetedSweepFollower(ImmutableList.of(FOLLOWER), txManager));
    sweeper.runInBackground();
    return sweeper;
}
Also used : TargetedSweepFollower(com.palantir.atlasdb.sweep.queue.TargetedSweepFollower) SpecialTimestampsSupplier(com.palantir.atlasdb.sweep.queue.SpecialTimestampsSupplier)

Example 2 with SpecialTimestampsSupplier

use of com.palantir.atlasdb.sweep.queue.SpecialTimestampsSupplier in project atlasdb by palantir.

the class AtlasDbTestCase method setUp.

@Before
public void setUp() throws Exception {
    lockClient = LockClient.of(CLIENT);
    lockService = inMemoryTimeLockRule.getLockService();
    timelockService = inMemoryTimeLockRule.getLegacyTimelockService();
    timestampService = inMemoryTimeLockRule.getTimestampService();
    keyValueService = trackingKeyValueService(getBaseKeyValueService());
    TransactionTables.createTables(keyValueService);
    transactionService = spy(TransactionServices.createRaw(keyValueService, timestampService, false));
    conflictDetectionManager = ConflictDetectionManagers.createWithoutWarmingCache(keyValueService);
    sweepStrategyManager = SweepStrategyManagers.createDefault(keyValueService);
    sweepQueue = spy(TargetedSweeper.createUninitializedForTest(() -> sweepQueueShards));
    setUpTransactionManagers();
    sweepQueue.initialize(serializableTxManager);
    sweepTimestampSupplier = new SpecialTimestampsSupplier(() -> txManager.getUnreadableTimestamp(), () -> txManager.getImmutableTimestamp());
}
Also used : SpecialTimestampsSupplier(com.palantir.atlasdb.sweep.queue.SpecialTimestampsSupplier) Before(org.junit.Before)

Aggregations

SpecialTimestampsSupplier (com.palantir.atlasdb.sweep.queue.SpecialTimestampsSupplier)2 TargetedSweepFollower (com.palantir.atlasdb.sweep.queue.TargetedSweepFollower)1 Before (org.junit.Before)1