Class ResultRetryStrategy
- java.lang.Object
-
- org.apache.flink.table.runtime.operators.join.lookup.ResultRetryStrategy
-
- All Implemented Interfaces:
Serializable
,AsyncRetryStrategy<RowData>
public class ResultRetryStrategy extends Object implements AsyncRetryStrategy<RowData>
A utility class to wrap the data stream apiAsyncRetryStrategy
to support both sync and async retry in table module. The main consideration is making the class name not bind to async scope, and also highlight the retry predicate is only over the result (not exception).- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ResultRetryStrategy
NO_RETRY_STRATEGY
-
Constructor Summary
Constructors Constructor Description ResultRetryStrategy(AsyncRetryStrategy retryStrategy)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canRetry(int currentAttempts)
static ResultRetryStrategy
fixedDelayRetry(int maxAttempts, long backoffTimeMillis, Predicate<Collection<RowData>> resultPredicate)
Create a fixed-delay retry strategy by given params.long
getBackoffTimeMillis(int currentAttempts)
AsyncRetryPredicate<RowData>
getRetryPredicate()
-
-
-
Field Detail
-
NO_RETRY_STRATEGY
public static final ResultRetryStrategy NO_RETRY_STRATEGY
-
-
Constructor Detail
-
ResultRetryStrategy
@VisibleForTesting public ResultRetryStrategy(AsyncRetryStrategy retryStrategy)
-
-
Method Detail
-
fixedDelayRetry
public static ResultRetryStrategy fixedDelayRetry(int maxAttempts, long backoffTimeMillis, Predicate<Collection<RowData>> resultPredicate)
Create a fixed-delay retry strategy by given params.
-
canRetry
public boolean canRetry(int currentAttempts)
- Specified by:
canRetry
in interfaceAsyncRetryStrategy<RowData>
- Returns:
- whether the next attempt can happen
-
getBackoffTimeMillis
public long getBackoffTimeMillis(int currentAttempts)
- Specified by:
getBackoffTimeMillis
in interfaceAsyncRetryStrategy<RowData>
- Returns:
- the delay time of next attempt
-
getRetryPredicate
public AsyncRetryPredicate<RowData> getRetryPredicate()
- Specified by:
getRetryPredicate
in interfaceAsyncRetryStrategy<RowData>
- Returns:
- the defined retry predicate
AsyncRetryPredicate
-
-