backtype.storm.utils
Class StormBoundedExponentialBackoffRetry

java.lang.Object
  extended by org.apache.curator.retry.ExponentialBackoffRetry
      extended by org.apache.curator.retry.BoundedExponentialBackoffRetry
          extended by backtype.storm.utils.StormBoundedExponentialBackoffRetry
All Implemented Interfaces:
org.apache.curator.RetryPolicy

public class StormBoundedExponentialBackoffRetry
extends org.apache.curator.retry.BoundedExponentialBackoffRetry


Constructor Summary
StormBoundedExponentialBackoffRetry(int baseSleepTimeMs, int maxSleepTimeMs, int maxRetries)
          The class provides generic exponential-linear backoff retry strategy for storm.
 
Method Summary
 int getSleepTimeMs(int retryCount, long elapsedTimeMs)
           
 
Methods inherited from class org.apache.curator.retry.BoundedExponentialBackoffRetry
getMaxSleepTimeMs
 
Methods inherited from class org.apache.curator.retry.ExponentialBackoffRetry
getBaseSleepTimeMs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StormBoundedExponentialBackoffRetry

public 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 Detail

getSleepTimeMs

public int getSleepTimeMs(int retryCount,
                          long elapsedTimeMs)
Overrides:
getSleepTimeMs in class org.apache.curator.retry.BoundedExponentialBackoffRetry


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.