private static SweepBatchConfig getSweepBatchConfig(SweepConfig sweepConfig) { return ImmutableSweepBatchConfig.builder() .maxCellTsPairsToExamine(sweepConfig.readLimit()) .candidateBatchSize(sweepConfig.candidateBatchHint() .orElse(AtlasDbConstants.DEFAULT_SWEEP_CANDIDATE_BATCH_HINT)) .deleteBatchSize(sweepConfig.deleteBatchHint()) .build(); }
@Value.Default public SweepConfig sweep() { return SweepConfig.defaultSweepConfig(); }
public static ImmutableAtlasDbRuntimeConfig withSweepDisabled() { return ImmutableAtlasDbRuntimeConfig.builder() .sweep(SweepConfig.disabled()) .targetedSweep(TargetedSweepRuntimeConfig.disabled()) .build(); } }
metricsManager, sweepBatchConfigSource, () -> runtimeConfigSupplier.get().sweep().enabled(), () -> runtimeConfigSupplier.get().sweep().sweepThreads(), () -> runtimeConfigSupplier.get().sweep().pauseMillis(), () -> runtimeConfigSupplier.get().sweep().sweepPriorityOverrides(), persistentLockManager, specificTableSweeper);
@Test public void doesNotSweepDuringMigration() { assertThat(fromServices.getAtlasDbRuntimeConfig().sweep().enabled()).isFalse(); assertThat(fromServices.getAtlasDbRuntimeConfig().targetedSweep().enabled()).isFalse(); assertThat(toServices.getAtlasDbRuntimeConfig().sweep().enabled()).isFalse(); assertThat(toServices.getAtlasDbRuntimeConfig().targetedSweep().enabled()).isFalse(); }
@Test public void canDeserializeRuntimeConfig() throws IOException { AtlasDbRuntimeConfig runtimeConfig = AtlasDbConfigs.OBJECT_MAPPER.readValue(TEST_RUNTIME_CONFIG_FILE, AtlasDbRuntimeConfig.class); assertThat(runtimeConfig.timestampClient().enableTimestampBatching()).isTrue(); assertThat(runtimeConfig.timelockRuntime()).isPresent(); assertThat(runtimeConfig.timelockRuntime().get().serversList().servers()) .containsExactlyInAnyOrder( "https://foo1:12345", "https://foo2:8421", "https://foo3:9421"); assertThat(runtimeConfig.timelockRuntime().get().serversList().sslConfiguration()).satisfies( sslConfiguration -> sslConfiguration.ifPresent(this::assertSslConfigDeserializedCorrectly)); assertThat(runtimeConfig.streamStorePersistence()).satisfies( persistenceConfig -> { assertThat(persistenceConfig.numBlocksToWriteBeforePause()).isEqualTo(7); assertThat(persistenceConfig.writePauseDurationMillis()).isEqualTo(77); }); assertThat(runtimeConfig.sweep().sweepPriorityOverrides()).satisfies( overrides -> { assertThat(overrides.priorityTables()).containsExactlyInAnyOrder("atlas.mission_critical_table"); assertThat(overrides.blacklistTables()).containsExactlyInAnyOrder( "atlas.bad_table", "atlas2.immutable_log"); }); }
@Value.Check public void check() { Preconditions.checkState(sweepThreads() > 0, "Must have a positive number of threads! " + "If your intention was to disable sweep, please set enabled to false."); }
metricsManager, sweepBatchConfigSource, () -> runtimeConfigSupplier.get().sweep().enabled(), () -> runtimeConfigSupplier.get().sweep().sweepThreads(), () -> runtimeConfigSupplier.get().sweep().pauseMillis(), () -> runtimeConfigSupplier.get().sweep().sweepPriorityOverrides(), persistentLockManager, specificTableSweeper);
@Test public void configWithoutSweepHasSweepDisabled() throws Exception { AtlasDbRuntimeConfig config = AtlasDbRuntimeConfig.withSweepDisabled(); assertFalse(config.sweep().enabled()); }
@Value.Check public void check() { Preconditions.checkState(sweepThreads() > 0, "Must have a positive number of threads! " + "If your intention was to disable sweep, please set enabled to false."); }
private static SweepBatchConfig getSweepBatchConfig(SweepConfig sweepConfig) { return ImmutableSweepBatchConfig.builder() .maxCellTsPairsToExamine(sweepConfig.readLimit()) .candidateBatchSize(sweepConfig.candidateBatchHint() .orElse(AtlasDbConstants.DEFAULT_SWEEP_CANDIDATE_BATCH_HINT)) .deleteBatchSize(sweepConfig.deleteBatchHint()) .build(); }
@Test public void configHasSweepEnabledByDefault() { AtlasDbRuntimeConfig config = AtlasDbRuntimeConfig.defaultRuntimeConfig(); assertTrue(config.sweep().enabled()); }
public static ImmutableAtlasDbRuntimeConfig withSweepDisabled() { return ImmutableAtlasDbRuntimeConfig.builder() .sweep(SweepConfig.disabled()) .targetedSweep(TargetedSweepRuntimeConfig.disabled()) .build(); } }
@Value.Default public SweepConfig sweep() { return SweepConfig.defaultSweepConfig(); }