public class ExponentialRetryPolicy extends Object
| Constructor and Description |
|---|
ExponentialRetryPolicy()
Initializes a new instance of the
ExponentialRetryPolicy class. |
ExponentialRetryPolicy(int retryCount,
int minBackoff,
int maxBackoff,
int deltaBackoff)
Initializes a new instance of the
ExponentialRetryPolicy class. |
| Modifier and Type | Method and Description |
|---|---|
long |
getRetryInterval(int retryCount)
Returns backoff interval between 80% and 120% of the desired backoff,
multiply by 2^n-1 for exponential.
|
boolean |
shouldRetry(int retryCount,
int statusCode)
Returns if a request should be retried based on the retry count, current response,
and the current strategy.
|
public ExponentialRetryPolicy()
ExponentialRetryPolicy class.public ExponentialRetryPolicy(int retryCount,
int minBackoff,
int maxBackoff,
int deltaBackoff)
ExponentialRetryPolicy class.retryCount - The maximum number of retry attempts.minBackoff - The minimum backoff time.maxBackoff - The maximum backoff time.deltaBackoff - The value that will be used to calculate a random delta in the exponential delay
between retries.public boolean shouldRetry(int retryCount,
int statusCode)
retryCount - The current retry attempt count.statusCode - The status code of the response, or -1 for socket error.public long getRetryInterval(int retryCount)
retryCount - The current retry attempt count.Copyright © 2008–2020 Apache Software Foundation. All rights reserved.