Package alluxio.retry
Class ExponentialTimeBoundedRetry
- java.lang.Object
-
- alluxio.retry.TimeBoundedRetry
-
- alluxio.retry.ExponentialTimeBoundedRetry
-
- All Implemented Interfaces:
RetryPolicy
public final class ExponentialTimeBoundedRetry extends TimeBoundedRetry
A retry policy which uses exponential backoff and a maximum duration time bound. A final retry will be performed at the time bound before giving up. For example, with initial sleep 10ms, maximum sleep 100ms, and maximum duration 500ms, the sleep timings would be [10, 20, 40, 80, 100, 100, 100, 50], assuming the operation being retries takes no time. The 50 at the end is because the previous times add up to 450, so the mechanism sleeps for only 50ms before the final attempt. However, those are just the base sleep timings. For each sleep time, we multiply by a random number from 1 to 1.1 to add jitter to avoid hotspotting.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExponentialTimeBoundedRetry.Builder
Builder for time bounded exponential retry mechanisms.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ExponentialTimeBoundedRetry.Builder
builder()
protected java.time.Duration
computeNextWaitTime()
-
Methods inherited from class alluxio.retry.TimeBoundedRetry
attempt, getAttemptCount
-
-
-
-
Method Detail
-
computeNextWaitTime
protected java.time.Duration computeNextWaitTime()
- Specified by:
computeNextWaitTime
in classTimeBoundedRetry
- Returns:
- how long to wait before the next retry
-
builder
public static ExponentialTimeBoundedRetry.Builder builder()
- Returns:
- a builder
-
-