@Test public void configurationBelowMinimumIsSetToMinimum() { SweepDelay negativeDelay = new SweepDelay(-5L); assertThat(negativeDelay.getNextPause(SUCCESS)).isEqualTo(MIN_PAUSE_MILLIS); }
long getNextPause(SweepIterationResult result) { return SweepIterationResults.caseOf(result) .success(this::updateCurrentPauseAndGet) .unableToAcquireShard_(maxPauseMillis) .insufficientConsistency_(BACKOFF) .otherError_(maxPauseMillis) .disabled_(BACKOFF); }
SweepDelay { long getNextPause(SweepIterationResult result) { return SweepIterationResults.caseOf(result) .success(this::updateCurrentPauseAndGet) .unableToAcquireShard_(maxPauseMillis) .insufficientConsistency_(BACKOFF) .otherError_(maxPauseMillis) .disabled_(BACKOFF); } }
SweepDelay { long getNextPause(SweepIterationResult result) { return SweepIterationResults.caseOf(result) .success(this::updateCurrentPauseAndGet) .unableToAcquireShard_(maxPauseMillis) .insufficientConsistency_(BACKOFF) .otherError_(maxPauseMillis) .disabled_(BACKOFF); } SweepDelay(long configPause); }
SweepDelay { long getNextPause(SweepIterationResult result) { return SweepIterationResults.caseOf(result) .success(this::updateCurrentPauseAndGet) .unableToAcquireShard_(maxPauseMillis) .insufficientConsistency_(BACKOFF) .otherError_(maxPauseMillis) .disabled_(BACKOFF); } SweepDelay(long configPause);  }
SweepDelay { long getNextPause(SweepIterationResult result) { return SweepIterationResults.caseOf(result) .success(this::updateCurrentPauseAndGet) .unableToAcquireShard_(maxPauseMillis) .insufficientConsistency_(BACKOFF) .otherError_(maxPauseMillis) .disabled_(BACKOFF); } SweepDelay(long configPause);   }