Class TokenBucketRetryCondition.Builder
- java.lang.Object
-
- software.amazon.awssdk.core.retry.conditions.TokenBucketRetryCondition.Builder
-
- Enclosing class:
- TokenBucketRetryCondition
public static final class TokenBucketRetryCondition.Builder extends Object
Configure and create aTokenBucketRetryCondition.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TokenBucketRetryConditionbuild()Build aTokenBucketRetryConditionusing the provided configuration.TokenBucketRetryCondition.BuilderexceptionCostFunction(TokenBucketExceptionCostFunction exceptionCostFunction)Configure aTokenBucketExceptionCostFunctionthat is used to calculate the number of tokens that should be taken out of the bucket for each specific exception.TokenBucketRetryCondition.BuildertokenBucketSize(int tokenBucketSize)Specify the maximum number of tokens in the token bucket.
-
-
-
Method Detail
-
tokenBucketSize
public TokenBucketRetryCondition.Builder tokenBucketSize(int tokenBucketSize)
Specify the maximum number of tokens in the token bucket. This is also used as the initial value for the number of tokens in the bucket.
-
exceptionCostFunction
public TokenBucketRetryCondition.Builder exceptionCostFunction(TokenBucketExceptionCostFunction exceptionCostFunction)
Configure aTokenBucketExceptionCostFunctionthat is used to calculate the number of tokens that should be taken out of the bucket for each specific exception. These tokens will be returned in case of successful retries.
-
build
public TokenBucketRetryCondition build()
Build aTokenBucketRetryConditionusing the provided configuration.
-
-