Package org.apache.flink.util.concurrent
Class IncrementalDelayRetryStrategy
- java.lang.Object
-
- org.apache.flink.util.concurrent.IncrementalDelayRetryStrategy
-
- All Implemented Interfaces:
RetryStrategy
public class IncrementalDelayRetryStrategy extends Object implements RetryStrategy
An implementation ofRetryStrategy
that retries at an incremental delay with a cap.
-
-
Constructor Summary
Constructors Constructor Description IncrementalDelayRetryStrategy(int remainingRetries, Duration currentRetryDelay, Duration increment, Duration maxRetryDelay)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RetryStrategy
getNextRetryStrategy()
int
getNumRemainingRetries()
Duration
getRetryDelay()
-
-
-
Constructor Detail
-
IncrementalDelayRetryStrategy
public IncrementalDelayRetryStrategy(int remainingRetries, Duration currentRetryDelay, Duration increment, Duration maxRetryDelay)
- Parameters:
remainingRetries
- number of times to retrycurrentRetryDelay
- the current delay between retriesincrement
- the delay increment between retriesmaxRetryDelay
- the max delay between retries
-
-
Method Detail
-
getNumRemainingRetries
public int getNumRemainingRetries()
- Specified by:
getNumRemainingRetries
in interfaceRetryStrategy
- Returns:
- the number of remaining retries
-
getRetryDelay
public Duration getRetryDelay()
- Specified by:
getRetryDelay
in interfaceRetryStrategy
- Returns:
- the current delay if we need to retry
-
getNextRetryStrategy
public RetryStrategy getNextRetryStrategy()
- Specified by:
getNextRetryStrategy
in interfaceRetryStrategy
- Returns:
- the next retry strategy to current delay if we need to retry
-
-