com.netflix.astyanax.retry
Class ExponentialBackoff

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

public class ExponentialBackoff
extends SleepingRetryPolicy

Unbounded exponential backoff will sleep a random number of intervals within an exponentially increasing number of intervals.

Author:
elandau

Constructor Summary
ExponentialBackoff(int baseSleepTimeMs, int maxAttempts)
           
 
Method Summary
 RetryPolicy duplicate()
          Duplicate this policy into a fresh instance
 long getSleepTimeMs()
           
 String toString()
           
 
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

ExponentialBackoff

public ExponentialBackoff(int baseSleepTimeMs,
                          int maxAttempts)
Method Detail

getSleepTimeMs

public long getSleepTimeMs()
Specified by:
getSleepTimeMs in class SleepingRetryPolicy

duplicate

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

Returns:

toString

public String toString()
Overrides:
toString in class SleepingRetryPolicy


Copyright © 2012. All Rights Reserved.