Class 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long nextRetryWaitTime​(int retryCount, long elapsedRetryTime)
      Called before making an attempt to retry a failed operation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BoundExponentialBackoffRetryPolicy

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

      • 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)