public static class RetryCounter.RetryConfig extends Object
Modifier and Type | Field and Description |
---|---|
private RetryCounter.BackoffPolicy |
backoffPolicy |
private static RetryCounter.BackoffPolicy |
DEFAULT_BACKOFF_POLICY |
private float |
jitter |
private int |
maxAttempts |
private long |
maxSleepTime |
private long |
sleepInterval |
private TimeUnit |
timeUnit |
Constructor and Description |
---|
RetryConfig() |
RetryConfig(int maxAttempts,
long sleepInterval,
long maxSleepTime,
TimeUnit timeUnit,
RetryCounter.BackoffPolicy backoffPolicy) |
Modifier and Type | Method and Description |
---|---|
RetryCounter.BackoffPolicy |
getBackoffPolicy() |
float |
getJitter() |
int |
getMaxAttempts() |
long |
getMaxSleepTime() |
long |
getSleepInterval() |
TimeUnit |
getTimeUnit() |
RetryCounter.RetryConfig |
setBackoffPolicy(RetryCounter.BackoffPolicy backoffPolicy) |
RetryCounter.RetryConfig |
setJitter(float jitter) |
RetryCounter.RetryConfig |
setMaxAttempts(int maxAttempts) |
RetryCounter.RetryConfig |
setMaxSleepTime(long maxSleepTime) |
RetryCounter.RetryConfig |
setSleepInterval(long sleepInterval) |
RetryCounter.RetryConfig |
setTimeUnit(TimeUnit timeUnit) |
private int maxAttempts
private long sleepInterval
private long maxSleepTime
private RetryCounter.BackoffPolicy backoffPolicy
private float jitter
private static final RetryCounter.BackoffPolicy DEFAULT_BACKOFF_POLICY
public RetryConfig()
public RetryConfig(int maxAttempts, long sleepInterval, long maxSleepTime, TimeUnit timeUnit, RetryCounter.BackoffPolicy backoffPolicy)
public RetryCounter.RetryConfig setBackoffPolicy(RetryCounter.BackoffPolicy backoffPolicy)
public RetryCounter.RetryConfig setMaxAttempts(int maxAttempts)
public RetryCounter.RetryConfig setMaxSleepTime(long maxSleepTime)
public RetryCounter.RetryConfig setSleepInterval(long sleepInterval)
public RetryCounter.RetryConfig setTimeUnit(TimeUnit timeUnit)
public RetryCounter.RetryConfig setJitter(float jitter)
public int getMaxAttempts()
public long getMaxSleepTime()
public long getSleepInterval()
public TimeUnit getTimeUnit()
public float getJitter()
public RetryCounter.BackoffPolicy getBackoffPolicy()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.