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 retryBuilder
public RetryParam.Builder withInitialBackOffMs(long initialBackOffMs)
initialBackOffMs
- time interval valueBuilder
public RetryParam.Builder withMaxBackOffMs(long maxBackOffMs)
maxBackOffMs
- time interval valueBuilder
public RetryParam.Builder withBackOffMultiplier(int backOffMultiplier)
backOffMultiplier
- the multiplier to increase time interval after each retryBuilder
public RetryParam.Builder withRetryOnRateLimit(boolean retryOnRateLimit)
retryOnRateLimit
- whether to retry when the returned error is rate limitBuilder
public RetryParam build() throws ParamException
RetryParam
instance.RetryParam
ParamException