public class RetryOptions extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
RetryOptions.Builder
A Builder for ChannelOptions objects.
|
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_BACKOFF_MULTIPLIER
Multiplier to apply to wait times after failed retries (default value: 2).
|
static boolean |
DEFAULT_ENABLE_GRPC_RETRIES
Flag indicating whether or not grpc retries should be enabled.
|
static Set<io.grpc.Status.Code> |
DEFAULT_ENABLE_GRPC_RETRIES_SET
Constant
DEFAULT_ENABLE_GRPC_RETRIES_SET |
static int |
DEFAULT_INITIAL_BACKOFF_MILLIS
Initial amount of time to wait before retrying failed operations (default value: 5ms).
|
static int |
DEFAULT_MAX_ELAPSED_BACKOFF_MILLIS
Maximum amount of time to retry before failing the operation (default value: 60 seconds).
|
static int |
DEFAULT_MAX_SCAN_TIMEOUT_RETRIES
Maximum number of times to retry after a scan timeout
|
static int |
DEFAULT_READ_PARTIAL_ROW_TIMEOUT_MS
We can timeout when reading large cells with a low value here.
|
static int |
DEFAULT_STREAMING_BUFFER_SIZE
Constant
DEFAULT_STREAMING_BUFFER_SIZE=60 |
Constructor and Description |
---|
RetryOptions(boolean retriesEnabled,
boolean allowRetriesWithoutTimestamp,
int initialBackoffMillis,
double backoffMultiplier,
int maxElapsedBackoffMillis,
int streamingBufferSize,
int readPartialRowTimeoutMillis,
int maxScanTimeoutRetries,
Set<io.grpc.Status.Code> statusToRetryOn)
Constructor for RetryOptions.
|
Modifier and Type | Method and Description |
---|---|
boolean |
allowRetriesWithoutTimestamp()
Should retries be allowed even if a timestamp isn't set?
|
com.google.api.client.util.BackOff |
createBackoff()
createBackoff.
|
protected com.google.api.client.util.ExponentialBackOff.Builder |
createBackoffBuilder()
createBackoffBuilder.
|
boolean |
enableRetries()
Enable or disable retries.
|
boolean |
equals(Object obj) |
double |
getBackoffMultiplier()
Multiplier we will apply to backoff times between retries.
|
int |
getInitialBackoffMillis()
The amount of time in milliseconds we will wait for our first error retry.
|
int |
getMaxElapsedBackoffMillis()
Maximum amount of time we will retry an operation that is failing.
|
int |
getMaxScanTimeoutRetries()
The maximum number of times to retry after a scan timeout.
|
int |
getReadPartialRowTimeoutMillis()
A timeout for reading individual ReadRowsResponse messages from a stream.
|
int |
getStreamingBufferSize()
The maximum number of messages to buffer when scanning.
|
boolean |
isRetryable(io.grpc.Status.Code code)
Determines if the RPC should be retried based on the input
Status.Code . |
boolean |
retryOnDeadlineExceeded()
Whether to retry on deadline exceeded.
|
RetryOptions.Builder |
toBuilder()
toBuilder.
|
String |
toString() |
public static int DEFAULT_STREAMING_BUFFER_SIZE
DEFAULT_STREAMING_BUFFER_SIZE=60
public static final boolean DEFAULT_ENABLE_GRPC_RETRIES
public static final Set<io.grpc.Status.Code> DEFAULT_ENABLE_GRPC_RETRIES_SET
DEFAULT_ENABLE_GRPC_RETRIES_SET
public static final int DEFAULT_READ_PARTIAL_ROW_TIMEOUT_MS
public static final int DEFAULT_INITIAL_BACKOFF_MILLIS
public static final double DEFAULT_BACKOFF_MULTIPLIER
public static final int DEFAULT_MAX_ELAPSED_BACKOFF_MILLIS
public static final int DEFAULT_MAX_SCAN_TIMEOUT_RETRIES
public RetryOptions(boolean retriesEnabled, boolean allowRetriesWithoutTimestamp, int initialBackoffMillis, double backoffMultiplier, int maxElapsedBackoffMillis, int streamingBufferSize, int readPartialRowTimeoutMillis, int maxScanTimeoutRetries, Set<io.grpc.Status.Code> statusToRetryOn)
Constructor for RetryOptions.
retriesEnabled
- a boolean.allowRetriesWithoutTimestamp
- a boolean.initialBackoffMillis
- a int.backoffMultiplier
- a double.maxElapsedBackoffMillis
- a int.streamingBufferSize
- a int.readPartialRowTimeoutMillis
- a int.maxScanTimeoutRetries
- a int.statusToRetryOn
- a Set.public int getInitialBackoffMillis()
public int getMaxElapsedBackoffMillis()
public double getBackoffMultiplier()
public boolean enableRetries()
public boolean allowRetriesWithoutTimestamp()
public boolean retryOnDeadlineExceeded()
public int getStreamingBufferSize()
public int getReadPartialRowTimeoutMillis()
public int getMaxScanTimeoutRetries()
public boolean isRetryable(io.grpc.Status.Code code)
Status.Code
.code
- a Status.Code
object.public com.google.api.client.util.BackOff createBackoff()
createBackoff.
BackOff
object.protected com.google.api.client.util.ExponentialBackOff.Builder createBackoffBuilder()
createBackoffBuilder.
ExponentialBackOff.Builder
object.public RetryOptions.Builder toBuilder()
toBuilder.
RetryOptions.Builder
object.