Package org.apache.pulsar.client.impl
Class Backoff
- java.lang.Object
-
- org.apache.pulsar.client.impl.Backoff
-
public class Backoff extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_INTERVAL_IN_NANOSECONDS
static long
MAX_BACKOFF_INTERVAL_NANOSECONDS
-
Constructor Summary
Constructors Constructor Description Backoff(long initial, java.util.concurrent.TimeUnit unitInitial, long max, java.util.concurrent.TimeUnit unitMax, long mandatoryStop, java.util.concurrent.TimeUnit unitMandatoryStop)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
next()
void
reduceToHalf()
void
reset()
static boolean
shouldBackoff(long initialTimestamp, java.util.concurrent.TimeUnit unitInitial, int failedAttempts)
static boolean
shouldBackoff(long initialTimestamp, java.util.concurrent.TimeUnit unitInitial, int failedAttempts, long defaultInterval, long maxBackoffInterval)
-
-
-
Method Detail
-
next
public long next()
-
reduceToHalf
public void reduceToHalf()
-
reset
public void reset()
-
shouldBackoff
public static boolean shouldBackoff(long initialTimestamp, java.util.concurrent.TimeUnit unitInitial, int failedAttempts, long defaultInterval, long maxBackoffInterval)
-
shouldBackoff
public static boolean shouldBackoff(long initialTimestamp, java.util.concurrent.TimeUnit unitInitial, int failedAttempts)
-
-