public final class RetryParams extends Object implements Serializable
RetryHelper. The initial request is
executed immediately. It is given requestTimeoutMillis to complete or it is regarded as
a failure. If the request fails the calling thread sleeps for initialRetryDelayMillis.
Each subsequent failure the sleep interval is calculated as at least half of and no more than:
This proceeds until either the request is successful,initialRetryDelayMillis*retryDelayBackoffFactor^ NumFailures
retryMaxAttempts are made, or both
retryMinAttempts are made and totalRetryPeriodMillis have elapsed.
To construct RetryParams, first create a RetryParams.Builder. The builder is
mutable and each of the parameters can be set (any unset parameters will fallback to the
defaults). The Builder can be then used to create an immutable RetryParams
object.
For default RetryParams use getDefaultInstance(). Default settings are subject to
change release to release. If you require specific settings, explicitly create an instance of
RetryParams with the required settings.| Modifier and Type | Class and Description |
|---|---|
static class |
RetryParams.Builder
RetryParams builder.
|
| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_INITIAL_RETRY_DELAY_MILLIS |
static long |
DEFAULT_MAX_REQUEST_TIMEOUT |
static long |
DEFAULT_MAX_RETRY_DELAY_MILLIS |
static long |
DEFAULT_REQUEST_TIMEOUT_MILLIS |
static double |
DEFAULT_REQUEST_TIMEOUT_RETRY_FACTOR |
static double |
DEFAULT_RETRY_DELAY_BACKOFF_FACTOR |
static int |
DEFAULT_RETRY_MAX_ATTEMPTS |
static int |
DEFAULT_RETRY_MIN_ATTEMPTS |
static long |
DEFAULT_TOTAL_RETRY_PERIOD_MILLIS |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static RetryParams |
getDefaultInstance()
Retrieve an instance with the default parameters
|
long |
getInitialRetryDelayMillis() |
long |
getMaxRetryDelayMillis() |
long |
getRequestTimeoutMillis() |
double |
getRetryDelayBackoffFactor() |
int |
getRetryMaxAttempts() |
int |
getRetryMinAttempts() |
long |
getTotalRetryPeriodMillis() |
int |
hashCode() |
String |
toString() |
public static final long DEFAULT_REQUEST_TIMEOUT_MILLIS
public static final double DEFAULT_REQUEST_TIMEOUT_RETRY_FACTOR
public static final long DEFAULT_MAX_REQUEST_TIMEOUT
public static final int DEFAULT_RETRY_MIN_ATTEMPTS
public static final int DEFAULT_RETRY_MAX_ATTEMPTS
public static final long DEFAULT_INITIAL_RETRY_DELAY_MILLIS
public static final long DEFAULT_MAX_RETRY_DELAY_MILLIS
public static final double DEFAULT_RETRY_DELAY_BACKOFF_FACTOR
public static final long DEFAULT_TOTAL_RETRY_PERIOD_MILLIS
public static RetryParams getDefaultInstance()
public int getRetryMinAttempts()
public int getRetryMaxAttempts()
public long getInitialRetryDelayMillis()
public long getMaxRetryDelayMillis()
public double getRetryDelayBackoffFactor()
public long getTotalRetryPeriodMillis()
public long getRequestTimeoutMillis()
Copyright © 2016 Google. All rights reserved.