@Internal public class FullJitterBackoff extends Object
Constructor and Description |
---|
FullJitterBackoff() |
Modifier and Type | Method and Description |
---|---|
long |
calculateFullJitterBackoff(long baseMillis,
long maxMillis,
double power,
int attempt)
Calculates the sleep time for full jitter based on the given parameters.
|
void |
sleep(long millisToSleep)
Puts the current thread to sleep for the specified number of millis.
|
public long calculateFullJitterBackoff(long baseMillis, long maxMillis, double power, int attempt)
baseMillis
- the base backoff time in millisecondsmaxMillis
- the maximum backoff time in millisecondspower
- the power constant for exponential backoffattempt
- the attempt numberpublic void sleep(long millisToSleep) throws InterruptedException
Thread.sleep(long)
.millisToSleep
- the number of milliseconds to sleep forInterruptedException
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.