private void increasesBackUpToBaseConfig(Function<SweepBatchConfig, Integer> getValue) { assertThat(getValue.apply(adjustableConfig.getAdjustedSweepConfig()), is(anyOf( greaterThan(getValue.apply(previousConfig)), lessThanOrEqualTo(getValue.apply(adjustableConfig.getRawSweepConfig())) ))); }
private void reduceBatchSizeMultiplier() { SweepBatchConfig config = getRawSweepConfig(); double smallestSensibleBatchSizeMultiplier = 1.0 / NumberUtils.max( config.maxCellTsPairsToExamine(), config.candidateBatchSize(), config.deleteBatchSize()); if (batchSizeMultiplier == smallestSensibleBatchSizeMultiplier) { return; } double newBatchSizeMultiplier = batchSizeMultiplier / 2; if (newBatchSizeMultiplier < smallestSensibleBatchSizeMultiplier) { log.info("batchSizeMultiplier reached the smallest sensible value for the current sweep config ({}), " + "will not reduce further.", SafeArg.of("batchSizeMultiplier", smallestSensibleBatchSizeMultiplier)); batchSizeMultiplier = smallestSensibleBatchSizeMultiplier; } else { batchSizeMultiplier = newBatchSizeMultiplier; } } }
public SweepBatchConfig getAdjustedSweepConfig() { SweepBatchConfig sweepConfig = getRawSweepConfig(); double multiplier = batchSizeMultiplier; return ImmutableSweepBatchConfig.builder() .maxCellTsPairsToExamine(adjust(sweepConfig.maxCellTsPairsToExamine(), multiplier)) .candidateBatchSize(adjust(sweepConfig.candidateBatchSize(), multiplier)) .deleteBatchSize(adjust(sweepConfig.deleteBatchSize(), multiplier)) .build(); }
private void reduceBatchSizeMultiplier() { SweepBatchConfig config = getRawSweepConfig(); double smallestSensibleBatchSizeMultiplier = 1.0 / NumberUtils.max( config.maxCellTsPairsToExamine(), config.candidateBatchSize(), config.deleteBatchSize()); if (batchSizeMultiplier == smallestSensibleBatchSizeMultiplier) { return; } double newBatchSizeMultiplier = batchSizeMultiplier / 2; if (newBatchSizeMultiplier < smallestSensibleBatchSizeMultiplier) { log.info("batchSizeMultiplier reached the smallest sensible value for the current sweep config ({}), " + "will not reduce further.", SafeArg.of("batchSizeMultiplier", smallestSensibleBatchSizeMultiplier)); batchSizeMultiplier = smallestSensibleBatchSizeMultiplier; } else { batchSizeMultiplier = newBatchSizeMultiplier; } } }
public SweepBatchConfig getAdjustedSweepConfig() { SweepBatchConfig sweepConfig = getRawSweepConfig(); double multiplier = batchSizeMultiplier; return ImmutableSweepBatchConfig.builder() .maxCellTsPairsToExamine(adjust(sweepConfig.maxCellTsPairsToExamine(), multiplier)) .candidateBatchSize(adjust(sweepConfig.candidateBatchSize(), multiplier)) .deleteBatchSize(adjust(sweepConfig.deleteBatchSize(), multiplier)) .build(); }