Class ResultRetryStrategy
- java.lang.Object
-
- org.apache.flink.table.runtime.operators.join.lookup.ResultRetryStrategy
-
- All Implemented Interfaces:
Serializable,org.apache.flink.streaming.api.functions.async.AsyncRetryStrategy<org.apache.flink.table.data.RowData>
public class ResultRetryStrategy extends Object implements org.apache.flink.streaming.api.functions.async.AsyncRetryStrategy<org.apache.flink.table.data.RowData>
A utility class to wrap the data stream apiAsyncRetryStrategyto 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 ResultRetryStrategyNO_RETRY_STRATEGY
-
Constructor Summary
Constructors Constructor Description ResultRetryStrategy(org.apache.flink.streaming.api.functions.async.AsyncRetryStrategy retryStrategy)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanRetry(int currentAttempts)static ResultRetryStrategyfixedDelayRetry(int maxAttempts, long backoffTimeMillis, java.util.function.Predicate<Collection<org.apache.flink.table.data.RowData>> resultPredicate)Create a fixed-delay retry strategy by given params.longgetBackoffTimeMillis(int currentAttempts)org.apache.flink.streaming.api.functions.async.AsyncRetryPredicate<org.apache.flink.table.data.RowData>getRetryPredicate()
-
-
-
Field Detail
-
NO_RETRY_STRATEGY
public static final ResultRetryStrategy NO_RETRY_STRATEGY
-
-
Method Detail
-
fixedDelayRetry
public static ResultRetryStrategy fixedDelayRetry(int maxAttempts, long backoffTimeMillis, java.util.function.Predicate<Collection<org.apache.flink.table.data.RowData>> resultPredicate)
Create a fixed-delay retry strategy by given params.
-
canRetry
public boolean canRetry(int currentAttempts)
- Specified by:
canRetryin interfaceorg.apache.flink.streaming.api.functions.async.AsyncRetryStrategy<org.apache.flink.table.data.RowData>
-
getBackoffTimeMillis
public long getBackoffTimeMillis(int currentAttempts)
- Specified by:
getBackoffTimeMillisin interfaceorg.apache.flink.streaming.api.functions.async.AsyncRetryStrategy<org.apache.flink.table.data.RowData>
-
getRetryPredicate
public org.apache.flink.streaming.api.functions.async.AsyncRetryPredicate<org.apache.flink.table.data.RowData> getRetryPredicate()
- Specified by:
getRetryPredicatein interfaceorg.apache.flink.streaming.api.functions.async.AsyncRetryStrategy<org.apache.flink.table.data.RowData>
-
-