Class RetrySettings.Builder
- Enclosing class:
- RetrySettings
RetrySettings. See the class documentation of RetrySettings for a description of the different values that can be set.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()final org.threeten.bp.DurationThis method is obsolete.abstract DurationInitialRetryDelay controls the delay before the first retry/ poll.final org.threeten.bp.DurationThis method is obsolete.abstract DurationInitialRpcTimeout controls the timeout for the initial RPC.abstract intMaxAttempts defines the maximum number of retry attempts to perform.final org.threeten.bp.DurationThis method is obsolete.abstract DurationMaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier can't increase the retry delay higher than this amount.final org.threeten.bp.DurationThis method is obsolete.abstract DurationMaxRpcTimeout 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 doubleRetryDelayMultiplier controls the change in delay before the next retry or poll.abstract doubleRpcTimeoutMultiplier controls the change in RPC timeout.final org.threeten.bp.DurationThis method is obsolete.abstract DurationTotalTimeout has ultimate control over how long the logic should keep trying the remote call until it gives up completely.abstract booleanJitter determines if the delay time should be randomized.merge(RetrySettings.Builder newSettings) final RetrySettings.BuildersetInitialRetryDelay(org.threeten.bp.Duration initialDelay) This method is obsolete.abstract RetrySettings.BuildersetInitialRetryDelayDuration(Duration initialDelay) InitialRetryDelay controls the delay before the first retry/ poll.final RetrySettings.BuildersetInitialRpcTimeout(org.threeten.bp.Duration initialTimeout) This method is obsolete.abstract RetrySettings.BuildersetInitialRpcTimeoutDuration(Duration initialTimeout) InitialRpcTimeout controls the timeout for the initial RPC.abstract RetrySettings.BuildersetJittered(boolean jittered) Deprecated.Retries always jitter.setLogicalTimeout(Duration timeout) Configures the timeout settings with the given timeout such that the logical call will take no longer than the given timeout and each RPC attempt will use only the time remaining in the logical call as a timeout.setLogicalTimeout(org.threeten.bp.Duration timeout) This method is obsolete.abstract RetrySettings.BuildersetMaxAttempts(int maxAttempts) MaxAttempts defines the maximum number of retry attempts to perform.final RetrySettings.BuildersetMaxRetryDelay(org.threeten.bp.Duration maxDelay) This method is obsolete.abstract RetrySettings.BuildersetMaxRetryDelayDuration(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.final RetrySettings.BuildersetMaxRpcTimeout(org.threeten.bp.Duration maxTimeout) This method is obsolete.abstract RetrySettings.BuildersetMaxRpcTimeoutDuration(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.BuildersetRetryDelayMultiplier(double multiplier) RetryDelayMultiplier controls the change in delay before the next retry or poll.abstract RetrySettings.BuildersetRpcTimeoutMultiplier(double multiplier) RpcTimeoutMultiplier controls the change in RPC timeout.final RetrySettings.BuildersetTotalTimeout(org.threeten.bp.Duration totalTimeout) This method is obsolete.abstract RetrySettings.BuildersetTotalTimeoutDuration(Duration totalTimeout) TotalTimeout has ultimate control over how long the logic should keep trying the remote call until it gives up completely.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setTotalTimeout
@ObsoleteApi("Use setTotalTimeoutDuration(java.time.Duration) instead") public final RetrySettings.Builder setTotalTimeout(org.threeten.bp.Duration totalTimeout) This method is obsolete. UsesetTotalTimeoutDuration(java.time.Duration)instead -
setTotalTimeoutDuration
TotalTimeout has ultimate control over how long the logic should keep trying the remote call until it gives up completely. The higher the total timeout, the more retries and polls can be attempted. If this value isDuration.ZERO, then the logic will instead use the number of attempts to determine retries. In the event that both maxAttempts and totalTimeout values are both 0, the logic will not retry. If this value is non-Duration.ZERO, and the retry duration has reaches the timeout value, the logic will give up retrying even the number of attempts is lower than the maxAttempts value.If there are no configurations, Retries have the default timeout value of
Duration.ZEROand LROs have a default total timeout value ofDuration.ofMillis(300000)(5 minutes). -
setInitialRetryDelay
@ObsoleteApi("Use setInitialRetryDelayDuration(java.time.Duration) instead") public final RetrySettings.Builder setInitialRetryDelay(org.threeten.bp.Duration initialDelay) This method is obsolete. UsesetInitialRetryDelayDuration(java.time.Duration)instead -
setInitialRetryDelayDuration
InitialRetryDelay controls the delay before the first retry/ poll. Subsequent retries and polls will use this value adjusted according to the RetryDelayMultiplier.If there are no configurations, Retries have the default initial retry delay value of
Duration.ZEROand LROs have a default initial poll delay value ofDuration.ofMillis(5000)(5 seconds). -
setRetryDelayMultiplier
RetryDelayMultiplier controls the change in delay before the next retry or poll. The retry delay of the previous call is multiplied by the RetryDelayMultiplier to calculate the retry delay for the next call.If there are no configurations, Retries have the default retry delay multiplier value of
1.0and LROs have a default retry delay multiplier of1.5. -
setMaxRetryDelay
@ObsoleteApi("Use setMaxRetryDelayDuration(java.time.Duration) instead") public final RetrySettings.Builder setMaxRetryDelay(org.threeten.bp.Duration maxDelay) This method is obsolete. UsesetMaxRetryDelayDuration(java.time.Duration)instead -
setMaxRetryDelayDuration
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.If there are no configurations, Retries have the default max retry delay value of
Duration.ZEROand LROs have a default max poll retry delay value ofDuration.ofMillis(45000)(45 seconds). -
setMaxAttempts
MaxAttempts defines the maximum number of retry attempts to perform. If this value is set to 0, the logic will instead use the totalTimeout value to determine retries. In the event that both the maxAttempts and totalTimeout values are both 0, the logic will not retry. If this value is greater than 0, and the number of attempts exceeds this limit, the logic will give up retrying even if the total retry time is still lower than totalTimeout.If there are no configurations, Retries and LROs have the default max attempt value of
0. LRO polling does not use this value by default.The first RPC invocation will be considered attempt #0. Subsequent calls (retries) will increment the number of attempts and the number of attempts will not exceed this value.
-
setJittered
Deprecated.Retries always jitter.Jitter determines if the delay time should be randomized. If jitter is set totruethe actual delay time is calculated in the following way:
The default value isactualDelay = rand_between(0, min(maxRetryDelay, exponentialDelay))true, and this method will be a no-op soon. -
setInitialRpcTimeout
@ObsoleteApi("Use setInitialRpcTimeoutDuration(java.time.Duration) instead") public final RetrySettings.Builder setInitialRpcTimeout(org.threeten.bp.Duration initialTimeout) This method is obsolete. UsesetInitialRpcTimeoutDuration(java.time.Duration)instead -
setInitialRpcTimeoutDuration
InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this value adjusted according to the RpcTimeoutMultiplier. RPC Timeout value ofDuration.ZEROallows the RPC to continue indefinitely (until it hits a Connect Timeout or the connection has been terminated).getTotalTimeout()caps how long the logic should keep trying the RPC until it gives up completely. IfgetTotalTimeout()is set, initialRpcTimeout should be <= totalTimeout.If there are no configurations, Retries have the default initial RPC timeout value of
Duration.ZERO. LRO polling does not use the Initial RPC Timeout value. -
setRpcTimeoutMultiplier
RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call is multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call.If there are no configurations, Retries have the default RPC Timeout Multiplier value of
1.0. LRO polling does not use the RPC Timeout Multiplier value. -
setMaxRpcTimeout
@ObsoleteApi("Use setMaxRpcTimeoutDuration(java.time.Duration) instead") public final RetrySettings.Builder setMaxRpcTimeout(org.threeten.bp.Duration maxTimeout) This method is obsolete. UsesetMaxRpcTimeoutDuration(java.time.Duration)instead -
setMaxRpcTimeoutDuration
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.If there are no configurations, Retries have the default Max RPC Timeout value of
Duration.ZERO. LRO polling does not use the Max RPC Timeout value. -
getTotalTimeout
@ObsoleteApi("Use getTotalTimeoutDuration() instead") public final org.threeten.bp.Duration getTotalTimeout()This method is obsolete. UsegetTotalTimeoutDuration()instead -
getTotalTimeoutDuration
TotalTimeout has ultimate control over how long the logic should keep trying the remote call until it gives up completely. The higher the total timeout, the more retries and polls can be attempted. If this value isDuration.ZERO, then the logic will instead use the number of attempts to determine retries. In the event that both maxAttempts and totalTimeout values are both 0, the logic will not retry. If this value is non-Duration.ZERO, and the retry duration has reaches the timeout value, the logic will give up retrying even the number of attempts is lower than the maxAttempts value.If there are no configurations, Retries have the default timeout value of
Duration.ZEROand LROs have a default total timeout value ofDuration.ofMillis(300000)(5 minutes). -
getInitialRetryDelay
@ObsoleteApi("Use getInitialRetryDelayDuration() instead") public final org.threeten.bp.Duration getInitialRetryDelay()This method is obsolete. UsegetInitialRetryDelayDuration()instead -
getInitialRetryDelayDuration
InitialRetryDelay controls the delay before the first retry/ poll. Subsequent retries and polls will use this value adjusted according to the RetryDelayMultiplier.If there are no configurations, Retries have the default initial retry delay value of
Duration.ZEROand LROs have a default initial poll delay value ofDuration.ofMillis(5000)(5 seconds). -
getRetryDelayMultiplier
public abstract double getRetryDelayMultiplier()RetryDelayMultiplier controls the change in delay before the next retry or poll. The retry delay of the previous call is multiplied by the RetryDelayMultiplier to calculate the retry delay for the next call.If there are no configurations, Retries have the default retry delay multiplier value of
1.0and LROs have a default retry delay multiplier of1.5. -
getMaxAttempts
public abstract int getMaxAttempts()MaxAttempts defines the maximum number of retry attempts to perform. If this value is set to 0, the logic will instead use the totalTimeout value to determine retries. In the event that both the maxAttempts and totalTimeout values are both 0, the logic will not retry. If this value is greater than 0, and the number of attempts exceeds this limit, the logic will give up retrying even if the total retry time is still lower than totalTimeout.If there are no configurations, Retries and LROs have the default max attempt value of
0. LRO polling does not use this value by default.The first RPC invocation will be considered attempt #0. Subsequent calls (retries) will increment the number of attempts and the number of attempts will not exceed this value.
-
isJittered
public abstract boolean isJittered()Jitter determines if the delay time should be randomized. In most cases, if jitter is set totruethe actual delay time is calculated in the following way:
The default value isactualDelay = rand_between(0, min(maxRetryDelay, exponentialDelay))true. -
getMaxRetryDelay
@ObsoleteApi("Use getMaxRetryDelayDuration() instead") public final org.threeten.bp.Duration getMaxRetryDelay()This method is obsolete. UsegetMaxRetryDelayDuration()instead -
getMaxRetryDelayDuration
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.If there are no configurations, Retries have the default max retry delay value of
Duration.ZEROand LROs have a default max poll retry delay value ofDuration.ofMillis(45000)(45 seconds). -
getInitialRpcTimeout
@ObsoleteApi("Use getInitialRpcTimeoutDuration() instead") public final org.threeten.bp.Duration getInitialRpcTimeout()This method is obsolete. UsegetInitialRpcTimeoutDuration()instead -
getInitialRpcTimeoutDuration
InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this value adjusted according to the RpcTimeoutMultiplier. RPC Timeout value ofDuration.ZEROallows the RPC to continue indefinitely (until it hits a Connect Timeout or the connection has been terminated).getTotalTimeout()caps how long the logic should keep trying the RPC until it gives up completely. IfgetTotalTimeout()is set, initialRpcTimeout should be <= totalTimeout.If there are no configurations, Retries have the default initial RPC timeout value of
Duration.ZERO. LRO polling does not use the Initial RPC Timeout value. -
getRpcTimeoutMultiplier
public abstract double getRpcTimeoutMultiplier()RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call is multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call.If there are no configurations, Retries have the default RPC Timeout Multiplier value of
1.0. LRO polling does not use the RPC Timeout Multiplier value. -
getMaxRpcTimeout
@ObsoleteApi("Use getMaxRpcTimeoutDuration() instead") public final org.threeten.bp.Duration getMaxRpcTimeout()This method is obsolete. UsegetMaxRpcTimeoutDuration()instead -
getMaxRpcTimeoutDuration
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.If there are no configurations, Retries have the default Max RPC Timeout value of
Duration.ZERO. LRO polling does not use the Max RPC Timeout value. -
setLogicalTimeout
@BetaApi @ObsoleteApi("Use setLogicalTimeout(java.time.Duration) instead") public RetrySettings.Builder setLogicalTimeout(org.threeten.bp.Duration timeout) This method is obsolete. UsesetLogicalTimeout(java.time.Duration)instead. -
setLogicalTimeout
Configures the timeout settings with the given timeout such that the logical call will take no longer than the given timeout and each RPC attempt will use only the time remaining in the logical call as a timeout.Using this method in conjunction with individual
RetrySettingstimeout field setters is not advised, because only the order in which they are invoked determines which setter is respected. -
build
-
merge
-