public static class RetryParam.Builder
extends java.lang.Object
ConnectParam| Modifier and Type | Method and Description |
|---|---|
RetryParam |
build()
Verifies parameters and creates a new
RetryParam instance. |
RetryParam.Builder |
withBackOffMultiplier(int backOffMultiplier)
Sets multiplier to increase time interval after each retry.
|
RetryParam.Builder |
withInitialBackOffMs(long initialBackOffMs)
Sets the first time interval between two retries, units: millisecond.
|
RetryParam.Builder |
withMaxBackOffMs(long maxBackOffMs)
Sets the maximum time interval between two retries, units: millisecond.
|
RetryParam.Builder |
withMaxRetryTimes(int maxRetryTimes)
Sets the max retry times on failure.Default value is 75.
|
RetryParam.Builder |
withRetryOnRateLimit(boolean retryOnRateLimit)
Sets whether to retry when the returned error is rate limit.Default value is true.
|
public RetryParam.Builder withMaxRetryTimes(int maxRetryTimes)
maxRetryTimes - the maxinum times to retryBuilderpublic RetryParam.Builder withInitialBackOffMs(long initialBackOffMs)
initialBackOffMs - time interval valueBuilderpublic RetryParam.Builder withMaxBackOffMs(long maxBackOffMs)
maxBackOffMs - time interval valueBuilderpublic RetryParam.Builder withBackOffMultiplier(int backOffMultiplier)
backOffMultiplier - the multiplier to increase time interval after each retryBuilderpublic RetryParam.Builder withRetryOnRateLimit(boolean retryOnRateLimit)
retryOnRateLimit - whether to retry when the returned error is rate limitBuilderpublic RetryParam build() throws ParamException
RetryParam instance.RetryParamParamException