private static class PredefinedRetryPolicies.SDKDefaultBackoffStrategy extends java.lang.Object implements RetryPolicy.BackoffStrategy
Modifier and Type | Field and Description |
---|---|
private static int |
BASE_DELAY
Base sleep time (milliseconds) for all exceptions.
|
private static int |
MAX_BACKOFF_IN_MILLISECONDS
Maximum exponential back-off time before retrying a request
|
private java.util.Random |
random
For generating a random scale factor
|
NO_DELAY
Modifier | Constructor and Description |
---|---|
private |
SDKDefaultBackoffStrategy() |
Modifier and Type | Method and Description |
---|---|
long |
delayBeforeNextRetry(AmazonWebServiceRequest originalRequest,
AmazonClientException exception,
int retriesAttempted)
Returns the delay (in milliseconds) before next retry attempt.
|
private static final int BASE_DELAY
private static final int MAX_BACKOFF_IN_MILLISECONDS
private final java.util.Random random
public final long delayBeforeNextRetry(AmazonWebServiceRequest originalRequest, AmazonClientException exception, int retriesAttempted)
delayBeforeNextRetry
in interface RetryPolicy.BackoffStrategy
originalRequest
- The original request object being executed. For
performance reason, this object is not a defensive copy,
and caller should not attempt to modify its data.exception
- The exception from the failed request, represented as an
AmazonClientException object. There are two types of
exception that will be passed to this method:
retriesAttempted
- The number of times the current request has been attempted
(not including the next attempt after the delay).