public class ExponentialBackoffRetry extends Object
Constructor and Description |
---|
ExponentialBackoffRetry(int baseSleepTimeMs,
int maxRetries) |
ExponentialBackoffRetry(int baseSleepTimeMs,
int maxRetries,
int maxSleepMs) |
Modifier and Type | Method and Description |
---|---|
boolean |
allowRetry(int retryCount,
long elapsedTimeMs,
RetrySleeper sleeper) |
int |
getBaseSleepTimeMs() |
int |
getN() |
protected int |
getSleepTimeMs(int retryCount,
long elapsedTimeMs) |
public ExponentialBackoffRetry(int baseSleepTimeMs, int maxRetries)
baseSleepTimeMs
- initial amount of time to wait between retriesmaxRetries
- max number of times to retrypublic ExponentialBackoffRetry(int baseSleepTimeMs, int maxRetries, int maxSleepMs)
baseSleepTimeMs
- initial amount of time to wait between retriesmaxRetries
- max number of times to retrymaxSleepMs
- max time in ms to sleep on each retrypublic int getBaseSleepTimeMs()
protected int getSleepTimeMs(int retryCount, long elapsedTimeMs)
public int getN()
public boolean allowRetry(int retryCount, long elapsedTimeMs, RetrySleeper sleeper)
allowRetry
in interface RetryPolicy
Copyright © 2016. All Rights Reserved.