Class FullJitterBackoff
- java.lang.Object
-
- org.apache.flink.streaming.connectors.kinesis.proxy.FullJitterBackoff
-
@Internal public class FullJitterBackoff extends Object
Used to calculate full jitter backoff sleep durations.- See Also:
- Exponential Backoff and Jitter
-
-
Constructor Summary
Constructors Constructor Description FullJitterBackoff()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcalculateFullJitterBackoff(long baseMillis, long maxMillis, double power, int attempt)Calculates the sleep time for full jitter based on the given parameters.voidsleep(long millisToSleep)Puts the current thread to sleep for the specified number of millis.
-
-
-
Method Detail
-
calculateFullJitterBackoff
public long calculateFullJitterBackoff(long baseMillis, long maxMillis, double power, int attempt)Calculates the sleep time for full jitter based on the given parameters.- Parameters:
baseMillis- the base backoff time in millisecondsmaxMillis- the maximum backoff time in millisecondspower- the power constant for exponential backoffattempt- the attempt number- Returns:
- the time to wait before trying again
-
sleep
public void sleep(long millisToSleep) throws InterruptedExceptionPuts the current thread to sleep for the specified number of millis. Simply delegates toThread.sleep(long).- Parameters:
millisToSleep- the number of milliseconds to sleep for- Throws:
InterruptedException
-
-