use of com.palantir.atlasdb.sweep.CellsSweeper in project atlasdb by palantir.
the class TestSweeperModule method provideSweepTaskRunner.
@Provides
@Singleton
public SweepTaskRunner provideSweepTaskRunner(SerializableTransactionManager txm, @Named("kvs") KeyValueService kvs, TransactionService transactionService, SweepStrategyManager sweepStrategyManager, Follower follower, PersistentLockManager persistentLockManager, ServicesConfig config) {
LongSupplier unreadable = unreadableTs.orElse(txm::getUnreadableTimestamp);
LongSupplier immutable = immutableTs.orElse(txm::getImmutableTimestamp);
return new SweepTaskRunner(kvs, unreadable, immutable, transactionService, sweepStrategyManager, new CellsSweeper(txm, kvs, persistentLockManager, ImmutableList.of(follower)));
}
use of com.palantir.atlasdb.sweep.CellsSweeper in project atlasdb by palantir.
the class TransactionManagers method initializeSweepEndpointAndBackgroundProcess.
private static BackgroundSweeperImpl initializeSweepEndpointAndBackgroundProcess(AtlasDbConfig config, Supplier<AtlasDbRuntimeConfig> runtimeConfigSupplier, Consumer<Object> env, KeyValueService kvs, TransactionService transactionService, SweepStrategyManager sweepStrategyManager, CleanupFollower follower, SerializableTransactionManager transactionManager, PersistentLockManager persistentLockManager) {
CellsSweeper cellsSweeper = new CellsSweeper(transactionManager, kvs, persistentLockManager, ImmutableList.of(follower));
SweepMetricsManager sweepMetricsManager = new SweepMetricsManager();
SweepTaskRunner sweepRunner = new SweepTaskRunner(kvs, transactionManager::getUnreadableTimestamp, transactionManager::getImmutableTimestamp, transactionService, sweepStrategyManager, cellsSweeper, sweepMetricsManager);
BackgroundSweeperPerformanceLogger sweepPerfLogger = new NoOpBackgroundSweeperPerformanceLogger();
AdjustableSweepBatchConfigSource sweepBatchConfigSource = AdjustableSweepBatchConfigSource.create(() -> getSweepBatchConfig(runtimeConfigSupplier.get().sweep(), config.keyValueService()));
SweepMetricsManager sweepMetrics = new SweepMetricsManager();
SpecificTableSweeper specificTableSweeper = initializeSweepEndpoint(env, kvs, transactionManager, sweepRunner, sweepPerfLogger, sweepMetrics, config.initializeAsync(), sweepBatchConfigSource);
BackgroundSweeperImpl backgroundSweeper = BackgroundSweeperImpl.create(sweepBatchConfigSource, () -> runtimeConfigSupplier.get().sweep().enabled(), () -> runtimeConfigSupplier.get().sweep().pauseMillis(), persistentLockManager, specificTableSweeper);
transactionManager.registerClosingCallback(backgroundSweeper::shutdown);
backgroundSweeper.runInBackground();
return backgroundSweeper;
}
Aggregations