Interface RetryPolicy.Builder
-
- All Superinterfaces:
Buildable
,CopyableBuilder<RetryPolicy.Builder,RetryPolicy>
,SdkBuilder<RetryPolicy.Builder,RetryPolicy>
- Enclosing class:
- RetryPolicy
public static interface RetryPolicy.Builder extends CopyableBuilder<RetryPolicy.Builder,RetryPolicy>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
additionalRetryConditionsAllowed()
RetryPolicy.Builder
additionalRetryConditionsAllowed(boolean additionalRetryConditionsAllowed)
Configure whether further conditions can be added to this policy after it is created.BackoffStrategy
backoffStrategy()
RetryPolicy.Builder
backoffStrategy(BackoffStrategy backoffStrategy)
Configure the backoff strategy that should be used for waiting in between retry attempts.RetryPolicy
build()
RetryPolicy.Builder
fastFailRateLimiting(Boolean fastFailRateLimiting)
Whether the client should immediately fail the request when not enough capacity is immediately available from the rate limiter to execute the request, instead of waiting for capacity to be available.Boolean
isFastFailRateLimiting()
Whether the client should immediately fail the request when not enough capacity is immediately available from the rate limiter to execute the request, instead of waiting for capacity to be available.Integer
numRetries()
RetryPolicy.Builder
numRetries(Integer numRetries)
Configure the maximum number of times that a single request should be retried, assuming it fails for a retryable error.RetryCondition
retryCapacityCondition()
RetryPolicy.Builder
retryCapacityCondition(RetryCondition retryCapacityCondition)
Configure theRetryCondition
that should be used to throttle the number of retries attempted by the SDK client as a whole.RetryCondition
retryCondition()
RetryPolicy.Builder
retryCondition(RetryCondition retryCondition)
Configure the condition under which the request should be retried.BackoffStrategy
throttlingBackoffStrategy()
RetryPolicy.Builder
throttlingBackoffStrategy(BackoffStrategy backoffStrategy)
Configure the backoff strategy that should be used for waiting in between retry attempts after a throttling error is encountered.-
Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copy
-
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation
-
-
-
-
Method Detail
-
additionalRetryConditionsAllowed
RetryPolicy.Builder additionalRetryConditionsAllowed(boolean additionalRetryConditionsAllowed)
Configure whether further conditions can be added to this policy after it is created. This may include service- specific retry conditions that may not otherwise be covered by theRetryCondition.defaultRetryCondition()
.By default, this is true.
-
additionalRetryConditionsAllowed
boolean additionalRetryConditionsAllowed()
-
backoffStrategy
RetryPolicy.Builder backoffStrategy(BackoffStrategy backoffStrategy)
Configure the backoff strategy that should be used for waiting in between retry attempts. If the retry is because of throttling reasons, thethrottlingBackoffStrategy(BackoffStrategy)
is used instead.
-
backoffStrategy
BackoffStrategy backoffStrategy()
- See Also:
backoffStrategy(BackoffStrategy)
-
throttlingBackoffStrategy
RetryPolicy.Builder throttlingBackoffStrategy(BackoffStrategy backoffStrategy)
Configure the backoff strategy that should be used for waiting in between retry attempts after a throttling error is encountered. If the retry is not because of throttling reasons, thebackoffStrategy(BackoffStrategy)
is used instead.
-
throttlingBackoffStrategy
BackoffStrategy throttlingBackoffStrategy()
-
retryCondition
RetryPolicy.Builder retryCondition(RetryCondition retryCondition)
Configure the condition under which the request should be retried.While this can be any interface that implements
RetryCondition
, it is encouraged to usenumRetries(Integer)
when attempting to limit the number of times the SDK will retry an attempt or theretryCapacityCondition(RetryCondition)
when attempting to configure the throttling of retries. This guidance is because the SDK uses theRetryPolicy.aggregateRetryCondition()
when determining whether or not to retry a request, and theaggregateRetryCondition
includes thenumRetries
andretryCapacityCondition
in its determination.
-
retryCondition
RetryCondition retryCondition()
- See Also:
retryCondition(RetryCondition)
-
retryCapacityCondition
RetryPolicy.Builder retryCapacityCondition(RetryCondition retryCapacityCondition)
Configure theRetryCondition
that should be used to throttle the number of retries attempted by the SDK client as a whole.While any
RetryCondition
(or null) can be used, by convention these conditions are usually stateful and work globally for the whole client to limit the overall capacity of the client to execute retries.By default the
TokenBucketRetryCondition
is used. This can be disabled by setting the value tonull
(notRetryPolicy#none()
, which would completely disable retries).
-
retryCapacityCondition
RetryCondition retryCapacityCondition()
- See Also:
retryCapacityCondition(RetryCondition)
-
numRetries
RetryPolicy.Builder numRetries(Integer numRetries)
Configure the maximum number of times that a single request should be retried, assuming it fails for a retryable error.
-
numRetries
Integer numRetries()
- See Also:
numRetries(Integer)
-
fastFailRateLimiting
RetryPolicy.Builder fastFailRateLimiting(Boolean fastFailRateLimiting)
Whether the client should immediately fail the request when not enough capacity is immediately available from the rate limiter to execute the request, instead of waiting for capacity to be available.- Parameters:
fastFailRateLimiting
- Whether to fast fail.
-
isFastFailRateLimiting
Boolean isFastFailRateLimiting()
Whether the client should immediately fail the request when not enough capacity is immediately available from the rate limiter to execute the request, instead of waiting for capacity to be available.
-
build
RetryPolicy build()
- Specified by:
build
in interfaceBuildable
- Specified by:
build
in interfaceSdkBuilder<RetryPolicy.Builder,RetryPolicy>
-
-