public class ExponentialBackOffStrategy extends AbstractBackOffStrategy
Constructor and Description |
---|
ExponentialBackOffStrategy(int baseBackOffTimeInSeconds)
Unlimited use ExponentialBackOffStrategy
|
ExponentialBackOffStrategy(int baseBackOffTimeInSeconds,
int maxNumAttempts)
Limited use ExponentialBackOffStrategy
|
Modifier and Type | Method and Description |
---|---|
protected long |
calculateBackOffTime(int attemptCount,
long baseSleepTime)
Calculate the amount of time in milliseconds that the strategy should back off for
|
backOff, reset
public ExponentialBackOffStrategy(int baseBackOffTimeInSeconds)
baseBackOffTimeInSeconds
- public ExponentialBackOffStrategy(int baseBackOffTimeInSeconds, int maxNumAttempts)
baseBackOffTimeInSeconds
- maxNumAttempts
- protected long calculateBackOffTime(int attemptCount, long baseSleepTime)
AbstractBackOffStrategy
calculateBackOffTime
in class AbstractBackOffStrategy
attemptCount
- the number of attempts the strategy has backed off. i.e. 1 -> this is the first attempt, 2 -> this is the second attempt, etc.baseSleepTime
- the minimum amount of time it should back off for in millisecondsCopyright © 2012–2016 The Apache Software Foundation. All rights reserved.