Class BoundExponentialBackoffRetryPolicy

java.lang.Object
org.apache.bookkeeper.zookeeper.ExponentialBackoffRetryPolicy
org.apache.bookkeeper.zookeeper.BoundExponentialBackoffRetryPolicy
All Implemented Interfaces:
RetryPolicy

public class BoundExponentialBackoffRetryPolicy extends ExponentialBackoffRetryPolicy
Retry policy that retries a set number of times with an increasing (up to a maximum bound) backoff time between retries.
  • Constructor Details

    • BoundExponentialBackoffRetryPolicy

      public BoundExponentialBackoffRetryPolicy(long baseBackoffTime, long maxBackoffTime, int maxRetries)
  • Method Details

    • nextRetryWaitTime

      public long nextRetryWaitTime(int retryCount, long elapsedRetryTime)
      Description copied from interface: RetryPolicy
      Called before making an attempt to retry a failed operation. Return 0 if an attempt needs to be made immediately.
      Specified by:
      nextRetryWaitTime in interface RetryPolicy
      Overrides:
      nextRetryWaitTime in class ExponentialBackoffRetryPolicy
      Parameters:
      retryCount - The number of times retried so far (0 for the first time).
      elapsedRetryTime - The elapsed time since the operation attempted. (in milliseconds)
      Returns:
      the elapsed time that the attempt needs to wait before retrying. (in milliseconds)