Package com.volcengine.retryer
Class ExponentialBackoffStrategy
- java.lang.Object
-
- com.volcengine.retryer.BackoffStrategy
-
- com.volcengine.retryer.ExponentialBackoffStrategy
-
- Direct Known Subclasses:
ExponentialWithRandomJitterBackoffStrategy
public class ExponentialBackoffStrategy extends BackoffStrategy
A backoff strategy that increases the delay exponentially with each retry. The delay is calculated as: Math.min(minRetryDelayMs * Math.pow(2, retryCount), maxRetryDelayMs)
-
-
Field Summary
-
Fields inherited from class com.volcengine.retryer.BackoffStrategy
maxRetryDelayMs, minRetryDelayMs
-
-
Constructor Summary
Constructors Modifier Constructor Description ExponentialBackoffStrategy()protectedExponentialBackoffStrategy(long minRetryDelayMs, long maxRetryDelayMs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcomputeDelay(int retryCount)-
Methods inherited from class com.volcengine.retryer.BackoffStrategy
getMaxRetryDelayMs, getMinRetryDelayMs, setMaxRetryDelayMs, setMinRetryDelayMs
-
-
-
-
Method Detail
-
computeDelay
public long computeDelay(int retryCount)
- Specified by:
computeDelayin classBackoffStrategy
-
-