public class RetryUntilElapsed extends Object
| Constructor and Description |
|---|
RetryUntilElapsed(int maxElapsedTimeMs,
int sleepMsBetweenRetries) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowRetry(int retryCount,
long elapsedTimeMs,
RetrySleeper sleeper)
Called when an operation has failed for some reason.
|
int |
getN() |
protected long |
getSleepTimeMs(int retryCount,
long elapsedTimeMs) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitallowRetrypublic RetryUntilElapsed(int maxElapsedTimeMs,
int sleepMsBetweenRetries)
public boolean allowRetry(int retryCount,
long elapsedTimeMs,
RetrySleeper sleeper)
RetryPolicyallowRetry in interface RetryPolicyretryCount - the number of times retried so far (0 the first time)elapsedTimeMs - the elapsed time in ms since the operation was attemptedsleeper - use this to sleep - DO NOT call Thread.sleepprotected long getSleepTimeMs(int retryCount,
long elapsedTimeMs)
public int getN()
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.