Package org.apache.bookkeeper.zookeeper
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 Summary
Constructors Constructor Description BoundExponentialBackoffRetryPolicy(long baseBackoffTime, long maxBackoffTime, int maxRetries)
-
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 org.apache.bookkeeper.zookeeper.ExponentialBackoffRetryPolicy
allowRetry
-
-
-
-
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 interfaceRetryPolicy
- Overrides:
nextRetryWaitTime
in classExponentialBackoffRetryPolicy
- 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)
-
-