public class DefaultRetryStrategy 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.| 构造器和说明 |
|---|
DefaultRetryStrategy() |
DefaultRetryStrategy(long timeout,
TimeUnit unit) |
| 限定符和类型 | 方法和说明 |
|---|---|
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)
Get the delay time before the retries-th retry is initiated.
|
protected boolean |
retryNotMatterActions(String errorCode,
String errorMessage) |
boolean |
shouldRetry(String action,
Exception ex)
The default retry strategy provided by the SDK, with the following rules:
1.
|
protected boolean |
shouldRetryWithOTSException(String action,
boolean isIdempotent,
String errorCode,
String errorMessage,
int httpStatus) |
public DefaultRetryStrategy()
public DefaultRetryStrategy(long timeout,
TimeUnit unit)
public RetryStrategy clone()
RetryStrategyclone 在接口中 RetryStrategyclone 在类中 Objectpublic int getRetries()
RetryStrategygetRetries 在接口中 RetryStrategyprotected boolean retryNotMatterActions(String errorCode, String errorMessage)
protected boolean shouldRetryWithOTSException(String action, boolean isIdempotent, String errorCode, String errorMessage, int httpStatus)
public boolean shouldRetry(String action, Exception ex)
action - Operation name, such as "ListTable", "GetRow", "PutRow", etc.ex - Error information from the last failed attempt, either a ClientException or OTSExceptionpublic long nextPause(String action, Exception ex)
RetryStrategynextPause 在接口中 RetryStrategyaction - Operation name, such as "ListTable", "GetRow", "PutRow", etc.ex - Error information from the last failed attempt, either a ClientException or a TableStoreExceptionCopyright © 2025. All Rights Reserved.