Search in sources :

Example 1 with CellsSweeper

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)));
}
Also used : CellsSweeper(com.palantir.atlasdb.sweep.CellsSweeper) LongSupplier(java.util.function.LongSupplier) SweepTaskRunner(com.palantir.atlasdb.sweep.SweepTaskRunner) Singleton(javax.inject.Singleton) Provides(dagger.Provides)

Example 2 with CellsSweeper

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;
}
Also used : BackgroundSweeperImpl(com.palantir.atlasdb.sweep.BackgroundSweeperImpl) AdjustableSweepBatchConfigSource(com.palantir.atlasdb.sweep.AdjustableSweepBatchConfigSource) SpecificTableSweeper(com.palantir.atlasdb.sweep.SpecificTableSweeper) CellsSweeper(com.palantir.atlasdb.sweep.CellsSweeper) NoOpBackgroundSweeperPerformanceLogger(com.palantir.atlasdb.sweep.NoOpBackgroundSweeperPerformanceLogger) SweepMetricsManager(com.palantir.atlasdb.sweep.metrics.SweepMetricsManager) SweepTaskRunner(com.palantir.atlasdb.sweep.SweepTaskRunner) NoOpBackgroundSweeperPerformanceLogger(com.palantir.atlasdb.sweep.NoOpBackgroundSweeperPerformanceLogger) BackgroundSweeperPerformanceLogger(com.palantir.atlasdb.sweep.BackgroundSweeperPerformanceLogger)

Aggregations

CellsSweeper (com.palantir.atlasdb.sweep.CellsSweeper)2 SweepTaskRunner (com.palantir.atlasdb.sweep.SweepTaskRunner)2 AdjustableSweepBatchConfigSource (com.palantir.atlasdb.sweep.AdjustableSweepBatchConfigSource)1 BackgroundSweeperImpl (com.palantir.atlasdb.sweep.BackgroundSweeperImpl)1 BackgroundSweeperPerformanceLogger (com.palantir.atlasdb.sweep.BackgroundSweeperPerformanceLogger)1 NoOpBackgroundSweeperPerformanceLogger (com.palantir.atlasdb.sweep.NoOpBackgroundSweeperPerformanceLogger)1 SpecificTableSweeper (com.palantir.atlasdb.sweep.SpecificTableSweeper)1 SweepMetricsManager (com.palantir.atlasdb.sweep.metrics.SweepMetricsManager)1 Provides (dagger.Provides)1 LongSupplier (java.util.function.LongSupplier)1 Singleton (javax.inject.Singleton)1