Search in sources :

Example 1 with SpecificTableSweeper

use of com.palantir.atlasdb.sweep.SpecificTableSweeper in project atlasdb by palantir.

the class TransactionManagers method initializeSweepEndpoint.

private static SpecificTableSweeper initializeSweepEndpoint(Consumer<Object> env, KeyValueService kvs, SerializableTransactionManager transactionManager, SweepTaskRunner sweepRunner, BackgroundSweeperPerformanceLogger sweepPerfLogger, SweepMetricsManager sweepMetrics, boolean initializeAsync, AdjustableSweepBatchConfigSource sweepBatchConfigSource) {
    SpecificTableSweeper specificTableSweeper = SpecificTableSweeper.create(transactionManager, kvs, sweepRunner, SweepTableFactory.of(), sweepPerfLogger, sweepMetrics, initializeAsync);
    env.accept(new SweeperServiceImpl(specificTableSweeper, sweepBatchConfigSource));
    return specificTableSweeper;
}
Also used : SpecificTableSweeper(com.palantir.atlasdb.sweep.SpecificTableSweeper) SweeperServiceImpl(com.palantir.atlasdb.sweep.SweeperServiceImpl)

Example 2 with SpecificTableSweeper

use of com.palantir.atlasdb.sweep.SpecificTableSweeper 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

SpecificTableSweeper (com.palantir.atlasdb.sweep.SpecificTableSweeper)2 AdjustableSweepBatchConfigSource (com.palantir.atlasdb.sweep.AdjustableSweepBatchConfigSource)1 BackgroundSweeperImpl (com.palantir.atlasdb.sweep.BackgroundSweeperImpl)1 BackgroundSweeperPerformanceLogger (com.palantir.atlasdb.sweep.BackgroundSweeperPerformanceLogger)1 CellsSweeper (com.palantir.atlasdb.sweep.CellsSweeper)1 NoOpBackgroundSweeperPerformanceLogger (com.palantir.atlasdb.sweep.NoOpBackgroundSweeperPerformanceLogger)1 SweepTaskRunner (com.palantir.atlasdb.sweep.SweepTaskRunner)1 SweeperServiceImpl (com.palantir.atlasdb.sweep.SweeperServiceImpl)1 SweepMetricsManager (com.palantir.atlasdb.sweep.metrics.SweepMetricsManager)1