public class ResultRetryStrategy extends Object implements AsyncRetryStrategy<RowData>
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).Modifier and Type | Field and Description |
---|---|
static ResultRetryStrategy |
NO_RETRY_STRATEGY |
Constructor and Description |
---|
ResultRetryStrategy(AsyncRetryStrategy retryStrategy) |
Modifier and Type | Method and 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() |
public static final ResultRetryStrategy NO_RETRY_STRATEGY
@VisibleForTesting public ResultRetryStrategy(AsyncRetryStrategy retryStrategy)
public static ResultRetryStrategy fixedDelayRetry(int maxAttempts, long backoffTimeMillis, Predicate<Collection<RowData>> resultPredicate)
public boolean canRetry(int currentAttempts)
canRetry
in interface AsyncRetryStrategy<RowData>
public long getBackoffTimeMillis(int currentAttempts)
getBackoffTimeMillis
in interface AsyncRetryStrategy<RowData>
public AsyncRetryPredicate<RowData> getRetryPredicate()
getRetryPredicate
in interface AsyncRetryStrategy<RowData>
AsyncRetryPredicate
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.