Class 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 api AsyncRetryStrategy 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
    • Constructor Detail

      • ResultRetryStrategy

        @VisibleForTesting
        public ResultRetryStrategy​(org.apache.flink.streaming.api.functions.async.AsyncRetryStrategy retryStrategy)
    • Method Detail

      • fixedDelayRetry

        public static ResultRetryStrategy fixedDelayRetry​(int maxAttempts,
                                                          long backoffTimeMillis,
                                                          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:
        canRetry in interface org.apache.flink.streaming.api.functions.async.AsyncRetryStrategy<org.apache.flink.table.data.RowData>
      • getBackoffTimeMillis

        public long getBackoffTimeMillis​(int currentAttempts)
        Specified by:
        getBackoffTimeMillis in interface org.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:
        getRetryPredicate in interface org.apache.flink.streaming.api.functions.async.AsyncRetryStrategy<org.apache.flink.table.data.RowData>