public class AlwaysRetryStrategy 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.
AlwaysRetryStrategy is an example of a retry logic that always retries within the maximum number of retry attempts.| 构造器和说明 |
|---|
AlwaysRetryStrategy() |
AlwaysRetryStrategy(int maxRetryTimes,
int maxRetryPauseInMillis) |
AlwaysRetryStrategy(int initialPauseInMillis,
int maxRetryTimes,
int maxRetryPauseInMillis) |
| 限定符和类型 | 方法和说明 |
|---|---|
AlwaysRetryStrategy |
clone()
Returns a RetryStrategy object of the same type that has not been retried.
|
int |
getMaxRetryPauseInMillis() |
int |
getMaxRetryTimes() |
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.
|
void |
setMaxRetryPauseInMillis(int maxRetryPauseInMillis) |
void |
setMaxRetryTimes(int maxRetryTimes) |
public AlwaysRetryStrategy()
public AlwaysRetryStrategy(int maxRetryTimes,
int maxRetryPauseInMillis)
public AlwaysRetryStrategy(int initialPauseInMillis,
int maxRetryTimes,
int maxRetryPauseInMillis)
public AlwaysRetryStrategy clone()
RetryStrategyclone 在接口中 RetryStrategyclone 在类中 Objectpublic int getRetries()
RetryStrategygetRetries 在接口中 RetryStrategypublic 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 TableStoreExceptionpublic int getMaxRetryTimes()
public void setMaxRetryTimes(int maxRetryTimes)
public int getMaxRetryPauseInMillis()
public void setMaxRetryPauseInMillis(int maxRetryPauseInMillis)
Copyright © 2025. All Rights Reserved.