com.google.cloud.bigtable.config
Class RetryOptions
- java.lang.Object
-
- com.google.cloud.bigtable.config.RetryOptions
-
- All Implemented Interfaces:
- Serializable, Cloneable
public class RetryOptions extends Object implements Serializable, Cloneable
Options for retrying requests, including back off configuration.- Version:
- $Id: $Id
- Author:
- sduskis
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
RetryOptions.Builder
A Builder for ChannelOptions objects.
-
Field Summary
Fields Modifier and Type Field and Description static double
DEFAULT_BACKOFF_MULTIPLIER
Multiplier to apply to wait times after failed retries (default value: 1.5).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
ConstantDEFAULT_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 timeoutstatic 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
ConstantDEFAULT_STREAMING_BUFFER_SIZE=60
-
Constructor Summary
Constructors 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)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
allowRetriesWithoutTimestamp()
Should retries be allowed even if a timestamp isn't set?static RetryOptions.Builder
builder()
protected RetryOptions
clone()
boolean
enableRetries()
Enable or disable retries.boolean
equals(Object obj)
double
getBackoffMultiplier()
Multiplier we will apply to backoff times between retries.static RetryOptions
getDefaultOptions()
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.Set<io.grpc.Status.Code>
getRetryableStatusCodes()
ReturnsSet
ofStatus.Code
that allow RPC retries.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 inputStatus.Code
.boolean
retryOnDeadlineExceeded()
Whether to retry on deadline exceeded.RetryOptions.Builder
toBuilder()
toBuilder.String
toString()
-
-
-
Field Detail
-
DEFAULT_STREAMING_BUFFER_SIZE
public static int DEFAULT_STREAMING_BUFFER_SIZE
ConstantDEFAULT_STREAMING_BUFFER_SIZE=60
-
DEFAULT_ENABLE_GRPC_RETRIES
public static final boolean DEFAULT_ENABLE_GRPC_RETRIES
Flag indicating whether or not grpc retries should be enabled. The default is to enable retries on failed idempotent operations.- See Also:
- Constant Field Values
-
DEFAULT_ENABLE_GRPC_RETRIES_SET
public static final Set<io.grpc.Status.Code> DEFAULT_ENABLE_GRPC_RETRIES_SET
ConstantDEFAULT_ENABLE_GRPC_RETRIES_SET
-
DEFAULT_READ_PARTIAL_ROW_TIMEOUT_MS
public static final int DEFAULT_READ_PARTIAL_ROW_TIMEOUT_MS
We can timeout when reading large cells with a low value here. With a 10MB cell limit, 60 seconds allows our connection to drop to ~170kbyte/s. A 10 second timeout requires 1Mbyte/s
-
DEFAULT_INITIAL_BACKOFF_MILLIS
public static final int DEFAULT_INITIAL_BACKOFF_MILLIS
Initial amount of time to wait before retrying failed operations (default value: 5ms).- See Also:
- Constant Field Values
-
DEFAULT_BACKOFF_MULTIPLIER
public static final double DEFAULT_BACKOFF_MULTIPLIER
Multiplier to apply to wait times after failed retries (default value: 1.5).- See Also:
- Constant Field Values
-
DEFAULT_MAX_ELAPSED_BACKOFF_MILLIS
public static final int DEFAULT_MAX_ELAPSED_BACKOFF_MILLIS
Maximum amount of time to retry before failing the operation (default value: 60 seconds).
-
DEFAULT_MAX_SCAN_TIMEOUT_RETRIES
public static final int DEFAULT_MAX_SCAN_TIMEOUT_RETRIES
Maximum number of times to retry after a scan timeout- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RetryOptions
@Deprecated public RetryOptions(boolean retriesEnabled, boolean allowRetriesWithoutTimestamp, int initialBackoffMillis, double backoffMultiplier, int maxElapsedBackoffMillis, int streamingBufferSize, int readPartialRowTimeoutMillis, int maxScanTimeoutRetries, Set<io.grpc.Status.Code> statusToRetryOn)
Deprecated.Constructor for RetryOptions.- Parameters:
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.
-
-
Method Detail
-
getDefaultOptions
public static RetryOptions getDefaultOptions()
-
builder
public static RetryOptions.Builder builder()
-
getInitialBackoffMillis
public int getInitialBackoffMillis()
The amount of time in milliseconds we will wait for our first error retry.- Returns:
- a int.
-
getMaxElapsedBackoffMillis
public int getMaxElapsedBackoffMillis()
Maximum amount of time we will retry an operation that is failing.- Returns:
- a int.
-
getBackoffMultiplier
public double getBackoffMultiplier()
Multiplier we will apply to backoff times between retries.- Returns:
- a double.
-
enableRetries
public boolean enableRetries()
Enable or disable retries.- Returns:
- a boolean.
-
allowRetriesWithoutTimestamp
public boolean allowRetriesWithoutTimestamp()
Should retries be allowed even if a timestamp isn't set?- Returns:
- a boolean.
-
retryOnDeadlineExceeded
public boolean retryOnDeadlineExceeded()
Whether to retry on deadline exceeded.- Returns:
- a boolean.
-
getStreamingBufferSize
public int getStreamingBufferSize()
The maximum number of messages to buffer when scanning.- Returns:
- a int.
-
getReadPartialRowTimeoutMillis
public int getReadPartialRowTimeoutMillis()
A timeout for reading individual ReadRowsResponse messages from a stream.- Returns:
- a int.
-
getMaxScanTimeoutRetries
public int getMaxScanTimeoutRetries()
The maximum number of times to retry after a scan timeout.- Returns:
- a int.
-
isRetryable
public boolean isRetryable(io.grpc.Status.Code code)
Determines if the RPC should be retried based on the inputStatus.Code
.- Parameters:
code
- aStatus.Code
object.- Returns:
- a boolean.
-
getRetryableStatusCodes
public Set<io.grpc.Status.Code> getRetryableStatusCodes()
ReturnsSet
ofStatus.Code
that allow RPC retries.- Returns:
- a
Set
.
-
toBuilder
public RetryOptions.Builder toBuilder()
toBuilder.- Returns:
- a
RetryOptions.Builder
object.
-
clone
protected RetryOptions clone()
-
-