com.netflix.astyanax.retry
Class BoundedExponentialBackoff

java.lang.Object
  extended by com.netflix.astyanax.retry.SleepingRetryPolicy
      extended by com.netflix.astyanax.retry.ExponentialBackoff
          extended by com.netflix.astyanax.retry.BoundedExponentialBackoff
All Implemented Interfaces:
RetryPolicy

public class BoundedExponentialBackoff
extends ExponentialBackoff

Bounded exponential backoff that will wait for no more than a provided max amount of time. The following examples show the maximum wait time for each attempt ExponentalBackoff(250, 10) 250 500 1000 2000 4000 8000 16000 32000 64000 128000 BoundedExponentialBackoff(250, 5000, 10) 250 500 1000 2000 4000 5000 5000 5000 5000 5000


Constructor Summary
BoundedExponentialBackoff(long baseSleepTimeMs, long maxSleepTimeMs, int max)
           
 
Method Summary
 RetryPolicy duplicate()
          Duplicate this policy into a fresh instance
 long getMaxSleepTimeMs()
           
 long getSleepTimeMs()
           
 java.lang.String toString()
           
 
Methods inherited from class com.netflix.astyanax.retry.ExponentialBackoff
getBaseSleepTimeMs
 
Methods inherited from class com.netflix.astyanax.retry.SleepingRetryPolicy
allowRetry, begin, failure, getAttemptCount, getMax, getMaxAttemptCount, success
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BoundedExponentialBackoff

public BoundedExponentialBackoff(long baseSleepTimeMs,
                                 long maxSleepTimeMs,
                                 int max)
Method Detail

getSleepTimeMs

public long getSleepTimeMs()
Overrides:
getSleepTimeMs in class ExponentialBackoff

duplicate

public RetryPolicy duplicate()
Description copied from interface: RetryPolicy
Duplicate this policy into a fresh instance

Specified by:
duplicate in interface RetryPolicy
Overrides:
duplicate in class ExponentialBackoff
Returns:

getMaxSleepTimeMs

public long getMaxSleepTimeMs()

toString

public java.lang.String toString()
Overrides:
toString in class ExponentialBackoff