Package alluxio.retry
Class ExponentialBackoffRetry
- java.lang.Object
-
- alluxio.retry.SleepingRetry
-
- alluxio.retry.ExponentialBackoffRetry
-
- All Implemented Interfaces:
RetryPolicy
@NotThreadSafe public class ExponentialBackoffRetry extends SleepingRetry
Each retry will cause a sleep to happen. This sleep will grow over time exponentially so each sleep gets much larger than the last. To make sure that this growth does not grow out of control, a max sleep is used as a bounding.
-
-
Constructor Summary
Constructors Constructor Description ExponentialBackoffRetry(int baseSleepTimeMs, int maxSleepMs, int maxRetries)
Constructs a new retry facility which sleeps for an exponentially increasing amount of time between retries.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected long
getSleepTime()
How long to sleep before the next retry is performed.-
Methods inherited from class alluxio.retry.SleepingRetry
attempt, getAttemptCount, getSleepUnit
-
-
-
-
Constructor Detail
-
ExponentialBackoffRetry
public ExponentialBackoffRetry(int baseSleepTimeMs, int maxSleepMs, int maxRetries)
Constructs a new retry facility which sleeps for an exponentially increasing amount of time between retries.- Parameters:
baseSleepTimeMs
- the sleep in milliseconds to begin withmaxSleepMs
- the max sleep in milliseconds as a boundingmaxRetries
- the max count of retries
-
-
Method Detail
-
getSleepTime
protected long getSleepTime()
Description copied from class:SleepingRetry
How long to sleep before the next retry is performed. This method is used withSleepingRetry.getSleepUnit()
, so all time given here must match the unit provided.- Specified by:
getSleepTime
in classSleepingRetry
-
-