@VisibleForTesting static TargetedSweeper createUninitializedForTest(MetricsManager metricsManager, Supplier<Boolean> enabled, Supplier<Integer> shards) { return createUninitialized(metricsManager, enabled, shards, 0, 0, ImmutableList.of()); }
private MultiTableSweepQueueWriter uninitializedTargetedSweeper( MetricsManager metricsManager, TargetedSweepInstallConfig config, Follower follower, Supplier<TargetedSweepRuntimeConfig> runtime) { if (!config.enableSweepQueueWrites()) { return MultiTableSweepQueueWriter.NO_OP; } return TargetedSweeper.createUninitialized( metricsManager, Suppliers.compose(TargetedSweepRuntimeConfig::enabled, runtime::get), Suppliers.compose(TargetedSweepRuntimeConfig::shards, runtime::get), config.conservativeThreads(), config.thoroughThreads(), ImmutableList.of(follower)); }
private void createAndInitializeSweepersAndWaitForOneBackgroundIteration(int sweepers, int shards, int threads, TimelockService stickyLockService) throws InterruptedException { for (int i = 0; i < sweepers; i++) { TargetedSweeper sweeperInstance = TargetedSweeper .createUninitialized(metricsManager, () -> true, () -> shards, threads, 0, ImmutableList.of()); sweeperInstance.initializeWithoutRunning( timestampsSupplier, stickyLockService, spiedKvs, txnService, mockFollower); sweeperInstance.runInBackground(); } waitUntilBackgroundSweepRunsOneIteration(); }
@VisibleForTesting static TargetedSweeper createUninitializedForTest(MetricsManager metricsManager, Supplier<Boolean> enabled, Supplier<Integer> shards) { return createUninitialized(metricsManager, enabled, shards, 0, 0, ImmutableList.of()); }
private MultiTableSweepQueueWriter uninitializedTargetedSweeper( MetricsManager metricsManager, TargetedSweepInstallConfig config, Follower follower, Supplier<TargetedSweepRuntimeConfig> runtime) { if (!config.enableSweepQueueWrites()) { return MultiTableSweepQueueWriter.NO_OP; } return TargetedSweeper.createUninitialized( metricsManager, Suppliers.compose(TargetedSweepRuntimeConfig::enabled, runtime::get), Suppliers.compose(TargetedSweepRuntimeConfig::shards, runtime::get), config.conservativeThreads(), config.thoroughThreads(), ImmutableList.of(follower)); }