Class RetryPolicyAdapter.Builder
java.lang.Object
software.amazon.awssdk.core.internal.retry.RetryPolicyAdapter.Builder
- All Implemented Interfaces:
RetryStrategy.Builder<RetryPolicyAdapter.Builder,,RetryPolicyAdapter> Buildable,SdkBuilder<RetryPolicyAdapter.Builder,RetryPolicyAdapter>
- Enclosing class:
RetryPolicyAdapter
public static class RetryPolicyAdapter.Builder
extends Object
implements RetryStrategy.Builder<RetryPolicyAdapter.Builder,RetryPolicyAdapter>
-
Method Summary
Modifier and TypeMethodDescriptionbackoffStrategy(BackoffStrategy backoffStrategy) Configure the backoff strategy used by the retry strategy.build()Build a newRetryStrategywith the current configuration on this builder.initialize(RetryPolicyContext retryPolicyContext) maxAttempts(int maxAttempts) Configure the maximum number of attempts used by the retry strategy.retryOnException(Predicate<Throwable> shouldRetry) Configure the strategy to retry when the provided predicate returns true, given a failure exception.retryPolicy(RetryPolicy retryPolicy) retryPolicyContext(RetryPolicyContext retryPolicyContext) throttlingBackoffStrategy(BackoffStrategy backoffStrategy) Configure the backoff strategy used for throttling exceptions by this strategy.treatAsThrottling(Predicate<Throwable> treatAsThrottling) Configure a predicate that determines whether a retryable exception is a throttling exception.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.awssdk.retries.api.RetryStrategy.Builder
retryOnException, retryOnExceptionInstanceOf, retryOnExceptionOrCause, retryOnExceptionOrCauseInstanceOf, retryOnRootCause, retryOnRootCauseInstanceOf, useClientDefaultsMethods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation
-
Method Details
-
retryOnException
Description copied from interface:RetryStrategy.BuilderConfigure the strategy to retry when the provided predicate returns true, given a failure exception.- Specified by:
retryOnExceptionin interfaceRetryStrategy.Builder<RetryPolicyAdapter.Builder,RetryPolicyAdapter>
-
maxAttempts
Description copied from interface:RetryStrategy.BuilderConfigure the maximum number of attempts used by the retry strategy.The actual number of attempts made may be less, depending on the retry strategy implementation. For example, the standard and adaptive retry modes both employ short-circuiting which reduces the maximum attempts during outages.
The default value for the standard and adaptive retry strategies is 3.
- Specified by:
maxAttemptsin interfaceRetryStrategy.Builder<RetryPolicyAdapter.Builder,RetryPolicyAdapter>
-
backoffStrategy
Description copied from interface:RetryStrategy.BuilderConfigure the backoff strategy used by the retry strategy.By default, this uses jittered exponential backoff.
- Specified by:
backoffStrategyin interfaceRetryStrategy.Builder<RetryPolicyAdapter.Builder,RetryPolicyAdapter>
-
throttlingBackoffStrategy
Description copied from interface:RetryStrategy.BuilderConfigure the backoff strategy used for throttling exceptions by this strategy.By default, this uses jittered exponential backoff.
- Specified by:
throttlingBackoffStrategyin interfaceRetryStrategy.Builder<RetryPolicyAdapter.Builder,RetryPolicyAdapter>
-
treatAsThrottling
Description copied from interface:RetryStrategy.BuilderConfigure a predicate that determines whether a retryable exception is a throttling exception. When this predicate returns true, the retry strategy will use theRetryStrategy.Builder.throttlingBackoffStrategy(software.amazon.awssdk.retries.api.BackoffStrategy). If it returns false, theRetryStrategy.Builder.backoffStrategy(software.amazon.awssdk.retries.api.BackoffStrategy)will be used. This predicate will not be called for non-retryable exceptions.- Specified by:
treatAsThrottlingin interfaceRetryStrategy.Builder<RetryPolicyAdapter.Builder,RetryPolicyAdapter>
-
retryPolicy
-
retryPolicyContext
-
initialize
-
build
Description copied from interface:RetryStrategy.BuilderBuild a newRetryStrategywith the current configuration on this builder.- Specified by:
buildin interfaceBuildable- Specified by:
buildin interfaceRetryStrategy.Builder<RetryPolicyAdapter.Builder,RetryPolicyAdapter> - Specified by:
buildin interfaceSdkBuilder<RetryPolicyAdapter.Builder,RetryPolicyAdapter> - Returns:
- an instance of T
-