@Beta @Deprecated public static class ExponentialBackOffPolicy.Builder extends Object
Modifier | Constructor and Description |
---|---|
protected |
Builder()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
ExponentialBackOffPolicy |
build()
Deprecated.
Builds a new instance of
ExponentialBackOffPolicy . |
int |
getInitialIntervalMillis()
Deprecated.
Returns the initial retry interval in milliseconds.
|
int |
getMaxElapsedTimeMillis()
Deprecated.
Returns the maximum elapsed time in milliseconds.
|
int |
getMaxIntervalMillis()
Deprecated.
Returns the maximum value of the back off period in milliseconds.
|
double |
getMultiplier()
Deprecated.
Returns the value to multiply the current interval with for each retry attempt.
|
NanoClock |
getNanoClock()
Deprecated.
Returns the nano clock.
|
double |
getRandomizationFactor()
Deprecated.
Returns the randomization factor to use for creating a range around the retry interval.
|
ExponentialBackOffPolicy.Builder |
setInitialIntervalMillis(int initialIntervalMillis)
Deprecated.
Sets the initial retry interval in milliseconds.
|
ExponentialBackOffPolicy.Builder |
setMaxElapsedTimeMillis(int maxElapsedTimeMillis)
Deprecated.
Sets the maximum elapsed time in milliseconds.
|
ExponentialBackOffPolicy.Builder |
setMaxIntervalMillis(int maxIntervalMillis)
Deprecated.
Sets the maximum value of the back off period in milliseconds.
|
ExponentialBackOffPolicy.Builder |
setMultiplier(double multiplier)
Deprecated.
Sets the value to multiply the current interval with for each retry attempt.
|
ExponentialBackOffPolicy.Builder |
setNanoClock(NanoClock nanoClock)
Deprecated.
Sets the nano clock (
NanoClock.SYSTEM by default). |
ExponentialBackOffPolicy.Builder |
setRandomizationFactor(double randomizationFactor)
Deprecated.
Sets the randomization factor to use for creating a range around the retry interval.
|
public ExponentialBackOffPolicy build()
ExponentialBackOffPolicy
.public final int getInitialIntervalMillis()
ExponentialBackOffPolicy.DEFAULT_INITIAL_INTERVAL_MILLIS
.public ExponentialBackOffPolicy.Builder setInitialIntervalMillis(int initialIntervalMillis)
ExponentialBackOffPolicy.DEFAULT_INITIAL_INTERVAL_MILLIS
. Must be > 0
.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final double getRandomizationFactor()
ExponentialBackOffPolicy.DEFAULT_RANDOMIZATION_FACTOR
.
A randomization factor of 0.5 results in a random period ranging between 50% below and 50% above the retry interval.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public ExponentialBackOffPolicy.Builder setRandomizationFactor(double randomizationFactor)
ExponentialBackOffPolicy.DEFAULT_RANDOMIZATION_FACTOR
. Must fall in the range 0 <=
randomizationFactor < 1
.
A randomization factor of 0.5 results in a random period ranging between 50% below and 50% above the retry interval.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final double getMultiplier()
ExponentialBackOffPolicy.DEFAULT_MULTIPLIER
.public ExponentialBackOffPolicy.Builder setMultiplier(double multiplier)
ExponentialBackOffPolicy.DEFAULT_MULTIPLIER
. Must be >= 1
.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final int getMaxIntervalMillis()
ExponentialBackOffPolicy.DEFAULT_MAX_INTERVAL_MILLIS
. Must be >= initialInterval
.public ExponentialBackOffPolicy.Builder setMaxIntervalMillis(int maxIntervalMillis)
ExponentialBackOffPolicy.DEFAULT_MAX_INTERVAL_MILLIS
.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final int getMaxElapsedTimeMillis()
ExponentialBackOffPolicy.DEFAULT_MAX_ELAPSED_TIME_MILLIS
.
If the time elapsed since an ExponentialBackOffPolicy
instance is created goes
past the max_elapsed_time then the method ExponentialBackOffPolicy.getNextBackOffMillis()
starts returning
BackOffPolicy.STOP
. The elapsed time can be reset by calling ExponentialBackOffPolicy.reset()
.
public ExponentialBackOffPolicy.Builder setMaxElapsedTimeMillis(int maxElapsedTimeMillis)
ExponentialBackOffPolicy.DEFAULT_MAX_ELAPSED_TIME_MILLIS
. Must be > 0
.
If the time elapsed since an ExponentialBackOffPolicy
instance is created goes
past the max_elapsed_time then the method ExponentialBackOffPolicy.getNextBackOffMillis()
starts returning
BackOffPolicy.STOP
. The elapsed time can be reset by calling ExponentialBackOffPolicy.reset()
.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final NanoClock getNanoClock()
public ExponentialBackOffPolicy.Builder setNanoClock(NanoClock nanoClock)
NanoClock.SYSTEM
by default).
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
Copyright © 2011–2023 Google. All rights reserved.