/** * Creates a targeted sweeper, without initializing any of the necessary resources. You must call the * {@link #initializeWithoutRunning(SpecialTimestampsSupplier, TimelockService, KeyValueService, * TransactionService, TargetedSweepFollower)} method before any writes can be made to the sweep queue, or before * the background sweep job can run. * * @param enabled live reloadable config controlling whether background threads should perform targeted sweep. * @param shardsConfig live reloadable config specifying the desired number of shards. Since the number of shards * must never be reduced, this will be ignored if the persisted number of shards is greater. * @param conservativeThreads number of conservative threads to use for background targeted sweep. * @param thoroughThreads number of thorough threads to use for background targeted sweep. * @param followers follower used for sweeps, as defined by your schema. * @return returns an uninitialized targeted sweeper */ public static TargetedSweeper createUninitialized(MetricsManager metrics, Supplier<Boolean> enabled, Supplier<Integer> shardsConfig, int conservativeThreads, int thoroughThreads, List<Follower> followers) { return new TargetedSweeper(metrics, enabled, shardsConfig, conservativeThreads, thoroughThreads, followers); }
/** * Creates a targeted sweeper, without initializing any of the necessary resources. You must call the * {@link #initializeWithoutRunning(SpecialTimestampsSupplier, TimelockService, KeyValueService, * TransactionService, TargetedSweepFollower)} method before any writes can be made to the sweep queue, or before * the background sweep job can run. * * @param enabled live reloadable config controlling whether background threads should perform targeted sweep. * @param shardsConfig live reloadable config specifying the desired number of shards. Since the number of shards * must never be reduced, this will be ignored if the persisted number of shards is greater. * @param conservativeThreads number of conservative threads to use for background targeted sweep. * @param thoroughThreads number of thorough threads to use for background targeted sweep. * @param followers follower used for sweeps, as defined by your schema. * @return returns an uninitialized targeted sweeper */ public static TargetedSweeper createUninitialized(MetricsManager metrics, Supplier<Boolean> enabled, Supplier<Integer> shardsConfig, int conservativeThreads, int thoroughThreads, List<Follower> followers) { return new TargetedSweeper(metrics, enabled, shardsConfig, conservativeThreads, thoroughThreads, followers); }