public class CustomRetryStrategy extends Object implements RetryStrategy
RetryStrategy, which is used to determine whether a retry is needed when an exception occurs, and provides the time interval for the current retry.
DefaultRetryStrategy is the default retry logic of the TableStore SDK.| 构造器和说明 |
|---|
CustomRetryStrategy() |
CustomRetryStrategy(long timeout,
TimeUnit unit) |
CustomRetryStrategy(long timeout,
TimeUnit unit,
boolean retryUnIdempotentWriteOperation) |
| 限定符和类型 | 方法和说明 |
|---|---|
RetryStrategy |
clone()
Returns a RetryStrategy object of the same type that has not been retried.
|
int |
getRetries()
Returns the number of retries for the current operation
|
long |
nextPause(String action,
Exception ex)
If it returns 0, it means not retryable; otherwise, it returns the interval time for this retry.
|
boolean |
shouldRetry(String action,
Exception ex)
Idempotent operations:
In this strategy, all read-related operations are considered idempotent, while all write-related operations are considered non-idempotent.
|
public CustomRetryStrategy()
public CustomRetryStrategy(long timeout,
TimeUnit unit)
public CustomRetryStrategy(long timeout,
TimeUnit unit,
boolean retryUnIdempotentWriteOperation)
timeout - Retry timeout durationunit - Timeout duration unitretryUnIdempotentWriteOperation - Whether to retry write operations in cases where idempotence is not guaranteedpublic RetryStrategy clone()
RetryStrategyclone 在接口中 RetryStrategyclone 在类中 Objectpublic int getRetries()
RetryStrategygetRetries 在接口中 RetryStrategypublic boolean shouldRetry(String action, Exception ex)
action - Operation name, such as "ListTable", "GetRow", "PutRow", etc.ex - Error information from the last failed access attempt, either a ClientException or OTSExceptionpublic long nextPause(String action, Exception ex)
nextPause 在接口中 RetryStrategyaction - Operation name, such as "ListTable", "GetRow", "PutRow", etc.ex - Error information from the last failed attempt, either ClientException or TableStoreExceptionCopyright © 2025. All Rights Reserved.