@Test public void configurationAboveDefaultMaximumIsRespected() { SweepDelay largeDelay = new SweepDelay(2 * DEFAULT_MAX_PAUSE_MILLIS); assertThat(largeDelay.getNextPause(SUCCESS)).isEqualTo(2 * DEFAULT_MAX_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);   }