public abstract static class RetrySettings.Builder extends Object
RetrySettings. See the class documentation of RetrySettings for a description of the different values that can be set.| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
RetrySettings |
build() |
abstract org.threeten.bp.Duration |
getInitialRetryDelay()
InitialRetryDelay controls the delay before the first retry.
|
abstract org.threeten.bp.Duration |
getInitialRpcTimeout()
InitialRpcTimeout controls the timeout for the initial RPC.
|
abstract int |
getMaxAttempts()
MaxAttempts defines the maximum number of attempts to perform.
|
abstract org.threeten.bp.Duration |
getMaxRetryDelay()
MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier
can't increase the retry delay higher than this amount.
|
abstract org.threeten.bp.Duration |
getMaxRpcTimeout()
MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier
can't increase the RPC timeout higher than this amount.
|
abstract double |
getRetryDelayMultiplier()
RetryDelayMultiplier controls the change in retry delay.
|
abstract double |
getRpcTimeoutMultiplier()
See the class documentation of
RetrySettings for a description of what this value
does. |
abstract org.threeten.bp.Duration |
getTotalTimeout()
TotalTimeout has ultimate control over how long the logic should keep trying the remote call
until it gives up completely.
|
abstract boolean |
isJittered()
Jitter determines if the delay time should be randomized.
|
RetrySettings.Builder |
merge(RetrySettings.Builder newSettings) |
abstract RetrySettings.Builder |
setInitialRetryDelay(org.threeten.bp.Duration initialDelay)
InitialRetryDelay controls the delay before the first retry.
|
abstract RetrySettings.Builder |
setInitialRpcTimeout(org.threeten.bp.Duration initialTimeout)
InitialRpcTimeout controls the timeout for the initial RPC.
|
abstract RetrySettings.Builder |
setJittered(boolean jittered)
Deprecated.
Retries always jitter.
|
abstract RetrySettings.Builder |
setMaxAttempts(int maxAttempts)
MaxAttempts defines the maximum number of attempts to perform.
|
abstract RetrySettings.Builder |
setMaxRetryDelay(org.threeten.bp.Duration maxDelay)
MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier
can't increase the retry delay higher than this amount.
|
abstract RetrySettings.Builder |
setMaxRpcTimeout(org.threeten.bp.Duration maxTimeout)
MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier
can't increase the RPC timeout higher than this amount.
|
abstract RetrySettings.Builder |
setRetryDelayMultiplier(double multiplier)
RetryDelayMultiplier controls the change in retry delay.
|
abstract RetrySettings.Builder |
setRpcTimeoutMultiplier(double multiplier)
See the class documentation of
RetrySettings for a description of what this value
does. |
abstract RetrySettings.Builder |
setTotalTimeout(org.threeten.bp.Duration totalTimeout)
TotalTimeout has ultimate control over how long the logic should keep trying the remote call
until it gives up completely.
|
public abstract RetrySettings.Builder setTotalTimeout(org.threeten.bp.Duration totalTimeout)
Duration.ZERO.public abstract RetrySettings.Builder setInitialRetryDelay(org.threeten.bp.Duration initialDelay)
Duration.ZERO.public abstract RetrySettings.Builder setRetryDelayMultiplier(double multiplier)
1.0.public abstract RetrySettings.Builder setMaxRetryDelay(org.threeten.bp.Duration maxDelay)
Duration.ZERO.public abstract RetrySettings.Builder setMaxAttempts(int maxAttempts)
0. If this value is greater than 0, and the number of attempts reaches this limit, the logic
will give up retrying even if the total retry time is still lower than TotalTimeout.@Deprecated public abstract RetrySettings.Builder setJittered(boolean jittered)
true
the actual delay time is calculated in the following way:
actualDelay = rand_between(0, min(maxRetryDelay, exponentialDelay))
The default value is true, and this method will be a no-op soon.public abstract RetrySettings.Builder setInitialRpcTimeout(org.threeten.bp.Duration initialTimeout)
Duration.ZERO.public abstract RetrySettings.Builder setRpcTimeoutMultiplier(double multiplier)
RetrySettings for a description of what this value
does. The default value is 1.0.public abstract RetrySettings.Builder setMaxRpcTimeout(org.threeten.bp.Duration maxTimeout)
Duration.ZERO.public abstract org.threeten.bp.Duration getTotalTimeout()
Duration.ZERO.public abstract org.threeten.bp.Duration getInitialRetryDelay()
Duration.ZERO.public abstract double getRetryDelayMultiplier()
1.0.public abstract int getMaxAttempts()
0. If this value is greater than 0, and the number of attempts reaches this limit, the logic
will give up retrying even if the total retry time is still lower than TotalTimeout.public abstract boolean isJittered()
true the actual delay time is calculated in the following way:
actualDelay = rand_between(0, min(maxRetryDelay, exponentialDelay))
The default value is true.public abstract org.threeten.bp.Duration getMaxRetryDelay()
Duration.ZERO.public abstract org.threeten.bp.Duration getInitialRpcTimeout()
Duration.ZERO.public abstract double getRpcTimeoutMultiplier()
RetrySettings for a description of what this value
does. The default value is 1.0.public abstract org.threeten.bp.Duration getMaxRpcTimeout()
public RetrySettings build()
public RetrySettings.Builder merge(RetrySettings.Builder newSettings)