com.google.appengine.tools.cloudstorage
Class RetryParams
- java.lang.Object
-
- com.google.appengine.tools.cloudstorage.RetryParams
-
- All Implemented Interfaces:
- Serializable
public final class RetryParams extends Object implements Serializable
Parameters for configuring exponential backoff. SeeRetryHelper
. The initial request is executed immediately. It is givenrequestTimeoutMillis
to complete or it is regarded as a failure. If the request fails the calling thread sleeps forinitialRetryDelayMillis
. Each subsequent failure the sleep interval is calculated as at least half of and no more than:initialRetryDelayMillis
*retryDelayBackoffFactor
^ NumFailuresretryMaxAttempts
are made, or bothretryMinAttempts
are made andtotalRetryPeriodMillis
have elapsed. To constructRetryParams
, first create aRetryParams.Builder
. The builder is mutable and each of the parameters can be set (any unset parameters will fallback to the defaults). TheBuilder
can be then used to create an immutableRetryParams
object. For defaultRetryParams
usegetDefaultInstance()
. Default settings are subject to change release to release. If you require specific settings, explicitly create an instance ofRetryParams
with the required settings.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
RetryParams.Builder
RetryParams builder.
-
Field Summary
Fields 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
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
equals(Object obj)
static RetryParams
getDefaultInstance()
Retrieve an instance with the default parameterslong
getInitialRetryDelayMillis()
long
getMaxRetryDelayMillis()
long
getRequestTimeoutMillis()
double
getRetryDelayBackoffFactor()
int
getRetryMaxAttempts()
int
getRetryMinAttempts()
long
getTotalRetryPeriodMillis()
int
hashCode()
String
toString()
-
-
-
Field Detail
-
DEFAULT_REQUEST_TIMEOUT_MILLIS
public static final long DEFAULT_REQUEST_TIMEOUT_MILLIS
- See Also:
- Constant Field Values
-
DEFAULT_REQUEST_TIMEOUT_RETRY_FACTOR
public static final double DEFAULT_REQUEST_TIMEOUT_RETRY_FACTOR
- See Also:
- Constant Field Values
-
DEFAULT_MAX_REQUEST_TIMEOUT
public static final long DEFAULT_MAX_REQUEST_TIMEOUT
- See Also:
- Constant Field Values
-
DEFAULT_RETRY_MIN_ATTEMPTS
public static final int DEFAULT_RETRY_MIN_ATTEMPTS
- See Also:
- Constant Field Values
-
DEFAULT_RETRY_MAX_ATTEMPTS
public static final int DEFAULT_RETRY_MAX_ATTEMPTS
- See Also:
- Constant Field Values
-
DEFAULT_INITIAL_RETRY_DELAY_MILLIS
public static final long DEFAULT_INITIAL_RETRY_DELAY_MILLIS
- See Also:
- Constant Field Values
-
DEFAULT_MAX_RETRY_DELAY_MILLIS
public static final long DEFAULT_MAX_RETRY_DELAY_MILLIS
- See Also:
- Constant Field Values
-
DEFAULT_RETRY_DELAY_BACKOFF_FACTOR
public static final double DEFAULT_RETRY_DELAY_BACKOFF_FACTOR
- See Also:
- Constant Field Values
-
DEFAULT_TOTAL_RETRY_PERIOD_MILLIS
public static final long DEFAULT_TOTAL_RETRY_PERIOD_MILLIS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDefaultInstance
public static RetryParams getDefaultInstance()
Retrieve an instance with the default parameters
-
getRetryMinAttempts
public int getRetryMinAttempts()
- Returns:
- the retryMinAttempts
-
getRetryMaxAttempts
public int getRetryMaxAttempts()
- Returns:
- the retryMaxAttempts
-
getInitialRetryDelayMillis
public long getInitialRetryDelayMillis()
- Returns:
- the initialRetryDelayMillis
-
getMaxRetryDelayMillis
public long getMaxRetryDelayMillis()
- Returns:
- the maxRetryDelayMillis
-
getRetryDelayBackoffFactor
public double getRetryDelayBackoffFactor()
- Returns:
- the maxRetryDelayBackoffFactor
-
getTotalRetryPeriodMillis
public long getTotalRetryPeriodMillis()
- Returns:
- the totalRetryPeriodMillis
-
getRequestTimeoutMillis
public long getRequestTimeoutMillis()
- Returns:
- the requestTimeoutMillis
-
-
Copyright © 2016 Google. All rights reserved.