Package org.apache.bookkeeper.zookeeper
Class BoundExponentialBackoffRetryPolicy
java.lang.Object
org.apache.bookkeeper.zookeeper.ExponentialBackoffRetryPolicy
org.apache.bookkeeper.zookeeper.BoundExponentialBackoffRetryPolicy
- All Implemented Interfaces:
RetryPolicy
Retry policy that retries a set number of times with an increasing (up to a
maximum bound) backoff time between retries.
-
Constructor Summary
ConstructorsConstructorDescriptionBoundExponentialBackoffRetryPolicy(long baseBackoffTime, long maxBackoffTime, int maxRetries) -
Method Summary
Modifier and TypeMethodDescriptionlongnextRetryWaitTime(int retryCount, long elapsedRetryTime) Called before making an attempt to retry a failed operation.Methods inherited from class org.apache.bookkeeper.zookeeper.ExponentialBackoffRetryPolicy
allowRetry
-
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:RetryPolicyCalled before making an attempt to retry a failed operation. Return 0 if an attempt needs to be made immediately.- Specified by:
nextRetryWaitTimein interfaceRetryPolicy- Overrides:
nextRetryWaitTimein 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)
-