类 RandomExponentialRetry
java.lang.Object
org.apache.pulsar.io.elasticsearch.RandomExponentialRetry
Implements the jitter backoff retry.
see https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明static final RandomExponentialRetrySingleton instance.final longMaximum time in seconds between two retries. -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明longrandomWaitInMs(int attempt, long backoffInMs) protected <T> Tprotected <T> Tretry(Callable<T> function, int maxAttempts, long initialBackoff, String source, RandomExponentialRetry.Time clock) longwaitInMs(int attempt, long backoffInMs)
-
字段详细资料
-
INSTANCE
Singleton instance. -
maxRetryTimeInSec
public final long maxRetryTimeInSecMaximum time in seconds between two retries.
-
-
构造器详细资料
-
RandomExponentialRetry
public RandomExponentialRetry() -
RandomExponentialRetry
public RandomExponentialRetry(long maxRetryTimeInSec)
-
-
方法详细资料
-
waitInMs
public long waitInMs(int attempt, long backoffInMs) -
randomWaitInMs
public long randomWaitInMs(int attempt, long backoffInMs) -
retry
protected <T> T retry(Callable<T> function, int maxAttempts, long initialBackoff, String source) throws Exception - 抛出:
Exception
-
retry
protected <T> T retry(Callable<T> function, int maxAttempts, long initialBackoff, String source, RandomExponentialRetry.Time clock) throws Exception - 抛出:
Exception
-