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, resetpublic LinearTimeBackOffStrategy(int baseBackOffTimeInSeconds)
public LinearTimeBackOffStrategy(int baseBackOffTimeInSeconds,
int maxAttempts)
protected long calculateBackOffTime(int attemptCount,
long baseSleepTime)
AbstractBackOffStrategycalculateBackOffTime in class AbstractBackOffStrategyattemptCount - 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 © 2020 The Apache Software Foundation. All rights reserved.