Class AsyncRetryStrategies.ExponentialBackoffDelayRetryStrategy<OUT>
java.lang.Object
org.apache.flink.streaming.util.retryable.AsyncRetryStrategies.ExponentialBackoffDelayRetryStrategy<OUT>
- All Implemented Interfaces:
Serializable,AsyncRetryStrategy<OUT>
- Enclosing class:
- AsyncRetryStrategies
public static class AsyncRetryStrategies.ExponentialBackoffDelayRetryStrategy<OUT>
extends Object
implements AsyncRetryStrategy<OUT>
ExponentialBackoffDelayRetryStrategy.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionExponentialBackoffDelayRetryStrategy(int maxAttempts, long initialDelay, long maxRetryDelay, double multiplier, Predicate<Collection<OUT>> resultPredicate, Predicate<Throwable> exceptionPredicate) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanRetry(int currentAttempts) longgetBackoffTimeMillis(int currentAttempts)
-
Constructor Details
-
ExponentialBackoffDelayRetryStrategy
public ExponentialBackoffDelayRetryStrategy(int maxAttempts, long initialDelay, long maxRetryDelay, double multiplier, Predicate<Collection<OUT>> resultPredicate, Predicate<Throwable> exceptionPredicate)
-
-
Method Details
-
canRetry
public boolean canRetry(int currentAttempts) - Specified by:
canRetryin interfaceAsyncRetryStrategy<OUT>- Returns:
- whether the next attempt can happen
-
getBackoffTimeMillis
public long getBackoffTimeMillis(int currentAttempts) - Specified by:
getBackoffTimeMillisin interfaceAsyncRetryStrategy<OUT>- Returns:
- the delay time of next attempt
-
getRetryPredicate
- Specified by:
getRetryPredicatein interfaceAsyncRetryStrategy<OUT>- Returns:
- the defined retry predicate
AsyncRetryPredicate
-