public class AttemptAndTimeBoundedExponentialBackOff extends AttemptBoundedExponentialBackOff
AttemptBoundedExponentialBackOff that bounds the total time that the backoff
is happening as well as the amount of retries. Acts exactly as a AttemptBoundedExponentialBackOff
unless the time interval has expired since the object was created. At this point, it will always
return BackOff.STOP. Note that reset does not reset the timer.
Implementation is not thread-safe.
DEFAULT_MULTIPLIER, DEFAULT_RANDOMIZATION_FACTOR| Constructor and Description |
|---|
AttemptAndTimeBoundedExponentialBackOff(int maximumNumberOfAttempts,
long initialIntervalMillis,
long maximumTotalWaitTimeMillis)
Constructs an instance of AttemptAndTimeBoundedExponentialBackoff.
|
AttemptAndTimeBoundedExponentialBackOff(int maximumNumberOfAttempts,
long initialIntervalMillis,
long maximumTotalWaitTimeMillis,
com.google.api.client.util.NanoClock nanoClock)
Constructs an instance of AttemptAndTimeBoundedExponentialBackoff.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
atMaxAttempts() |
long |
nextBackOffMillis() |
void |
setEndtimeMillis(long endTimeMillis) |
resetpublic AttemptAndTimeBoundedExponentialBackOff(int maximumNumberOfAttempts,
long initialIntervalMillis,
long maximumTotalWaitTimeMillis)
maximumNumberOfAttempts - The maximum number of attempts it will make.initialIntervalMillis - The original interval to wait between attempts in milliseconds.maximumTotalWaitTimeMillis - The maximum total time that this object will
allow more attempts in milliseconds.public AttemptAndTimeBoundedExponentialBackOff(int maximumNumberOfAttempts,
long initialIntervalMillis,
long maximumTotalWaitTimeMillis,
com.google.api.client.util.NanoClock nanoClock)
maximumNumberOfAttempts - The maximum number of attempts it will make.initialIntervalMillis - The original interval to wait between attempts in milliseconds.maximumTotalWaitTimeMillis - The maximum total time that this object will
allow more attempts in milliseconds.nanoClock - clock used to measure the time that has passed.public void setEndtimeMillis(long endTimeMillis)
public long nextBackOffMillis()
nextBackOffMillis in interface com.google.api.client.util.BackOffnextBackOffMillis in class AttemptBoundedExponentialBackOffpublic boolean atMaxAttempts()
atMaxAttempts in class AttemptBoundedExponentialBackOff