接口 RetryPolicy
-
- 所有已知实现类:
DefaultRetryPolicy
public interface RetryPolicyRetry policy that can be configured on a specific service client usingBceClientConfiguration.
-
-
字段概要
字段 修饰符和类型 字段 说明 static intDEFAULT_MAX_DELAY_IN_MILLISMaximum exponential back-off time before retrying a request.static intDEFAULT_MAX_ERROR_RETRYSDK default max retry count.static DefaultRetryPolicyDEFAULT_RETRY_POLICYSDK default retry policy.
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 longgetDelayBeforeNextRetryInMillis(BceClientException exception, int retriesAttempted)Returns the delay (in milliseconds) before next retry attempt.longgetMaxDelayInMillis()Returns the maximum delay time (in milliseconds) before retrying a request.intgetMaxErrorRetry()Returns the maximum number of retry attempts.
-
-
-
字段详细资料
-
DEFAULT_MAX_ERROR_RETRY
static final int DEFAULT_MAX_ERROR_RETRY
SDK default max retry count.- 另请参阅:
- 常量字段值
-
DEFAULT_MAX_DELAY_IN_MILLIS
static final int DEFAULT_MAX_DELAY_IN_MILLIS
Maximum exponential back-off time before retrying a request.- 另请参阅:
- 常量字段值
-
DEFAULT_RETRY_POLICY
static final DefaultRetryPolicy DEFAULT_RETRY_POLICY
SDK default retry policy.
-
-
方法详细资料
-
getMaxErrorRetry
int getMaxErrorRetry()
Returns the maximum number of retry attempts.- 返回:
- The maximum number of retry attempts.
-
getMaxDelayInMillis
long getMaxDelayInMillis()
Returns the maximum delay time (in milliseconds) before retrying a request.- 返回:
- the maximum delay time (in milliseconds) before retrying a request.
-
getDelayBeforeNextRetryInMillis
long getDelayBeforeNextRetryInMillis(BceClientException exception, int retriesAttempted)
Returns the delay (in milliseconds) before next retry attempt. A negative value indicates that no more retries should be made.- 参数:
exception- the exception from the failed request, represented as an BceClientException object.retriesAttempted- the number of times the current request has been attempted (not including the next attempt after the delay).- 返回:
- the delay (in milliseconds) before next retry attempt.A negative value indicates that no more retries should be made.
-
-