public class LinearTimeBackOffStrategy extends AbstractBackOffStrategy
AbstractBackOffStrategy
that causes back offs in linear increments. Each
attempt cause an increase back off period.
Calculated by attemptNumber * baseBackOffAmount.Constructor and Description |
---|
LinearTimeBackOffStrategy(int baseBackOffTimeInSeconds) |
LinearTimeBackOffStrategy(int baseBackOffTimeInSeconds,
int maxAttempts) |
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 LinearTimeBackOffStrategy(int baseBackOffTimeInSeconds)
public LinearTimeBackOffStrategy(int baseBackOffTimeInSeconds, int maxAttempts)
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.