Package org.apache.storm.utils
Class StormBoundedExponentialBackoffRetry
java.lang.Object
org.apache.storm.shade.org.apache.curator.retry.ExponentialBackoffRetry
org.apache.storm.shade.org.apache.curator.retry.BoundedExponentialBackoffRetry
org.apache.storm.utils.StormBoundedExponentialBackoffRetry
- All Implemented Interfaces:
- org.apache.storm.shade.org.apache.curator.RetryPolicy
public class StormBoundedExponentialBackoffRetry
extends org.apache.storm.shade.org.apache.curator.retry.BoundedExponentialBackoffRetry
- 
Constructor SummaryConstructorsConstructorDescriptionStormBoundedExponentialBackoffRetry(int baseSleepTimeMs, int maxSleepTimeMs, int maxRetries) The class provides generic exponential-linear backoff retry strategy for storm.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanallowRetry(int arg0, long arg1, org.apache.storm.shade.org.apache.curator.RetrySleeper arg2) intgetN()longgetSleepTimeMs(int retryCount, long elapsedTimeMs) Methods inherited from class org.apache.storm.shade.org.apache.curator.retry.BoundedExponentialBackoffRetrygetMaxSleepTimeMsMethods inherited from class org.apache.storm.shade.org.apache.curator.retry.ExponentialBackoffRetrygetBaseSleepTimeMsMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.storm.shade.org.apache.curator.RetryPolicyallowRetry
- 
Constructor Details- 
StormBoundedExponentialBackoffRetrypublic StormBoundedExponentialBackoffRetry(int baseSleepTimeMs, int maxSleepTimeMs, int maxRetries) The class provides generic exponential-linear backoff retry strategy for storm. It calculates threshold for exponentially increasing sleeptime for retries. Beyond this threshold, the sleeptime increase is linear.Also adds jitter for exponential/linear retry. It guarantees `currSleepTimeMs >= prevSleepTimeMs` and `baseSleepTimeMs <= currSleepTimeMs <= maxSleepTimeMs` 
 
- 
- 
Method Details- 
getSleepTimeMspublic long getSleepTimeMs(int retryCount, long elapsedTimeMs) - Overrides:
- getSleepTimeMsin class- org.apache.storm.shade.org.apache.curator.retry.BoundedExponentialBackoffRetry
 
- 
getNpublic int getN()
- 
allowRetrypublic boolean allowRetry(int arg0, long arg1, org.apache.storm.shade.org.apache.curator.RetrySleeper arg2) - Specified by:
- allowRetryin interface- org.apache.storm.shade.org.apache.curator.RetryPolicy
 
 
-