public class RetryStrategy
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
static class |
RetryStrategy.WeightAndReliableAddition |
限定符和类型 | 字段和说明 |
---|---|
protected static int |
BACKOFF_MULTIPLIER |
protected int |
baseAttempts |
static RetryStrategy |
DEFAULT |
static RetryStrategy |
FAIL_FAST |
protected int |
initBackoff |
protected int |
maxBackoff |
构造器和说明 |
---|
RetryStrategy(int initBackoff,
int maxBackoff,
int baseAttempts) |
限定符和类型 | 方法和说明 |
---|---|
long |
getNextDelay(int attempts) |
QCloudHttpRetryHandler |
getQCloudHttpRetryHandler() |
void |
onTaskEnd(boolean isTaskSuccess,
java.lang.Exception e) |
void |
setRetryHandler(QCloudHttpRetryHandler qCloudHttpRetryHandler) |
boolean |
shouldRetry(int attempts,
long millstook,
int addition) |
protected static final int BACKOFF_MULTIPLIER
protected final int initBackoff
protected final int maxBackoff
protected final int baseAttempts
public static RetryStrategy DEFAULT
public static RetryStrategy FAIL_FAST
public long getNextDelay(int attempts)
public boolean shouldRetry(int attempts, long millstook, int addition)
addition
- 可以为负值,表示减少重试public void onTaskEnd(boolean isTaskSuccess, java.lang.Exception e)
public void setRetryHandler(QCloudHttpRetryHandler qCloudHttpRetryHandler)
public QCloudHttpRetryHandler getQCloudHttpRetryHandler()