Package org.apache.pulsar.client.impl
Class Backoff
java.lang.Object
org.apache.pulsar.client.impl.Backoff
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
next()
void
void
reset()
static boolean
shouldBackoff
(long initialTimestamp, TimeUnit unitInitial, int failedAttempts) static boolean
shouldBackoff
(long initialTimestamp, TimeUnit unitInitial, int failedAttempts, long defaultInterval, long maxBackoffInterval)
-
Field Details
-
DEFAULT_INTERVAL_IN_NANOSECONDS
public static final long DEFAULT_INTERVAL_IN_NANOSECONDS -
MAX_BACKOFF_INTERVAL_NANOSECONDS
public static final long MAX_BACKOFF_INTERVAL_NANOSECONDS
-
-
Constructor Details
-
Backoff
-
-
Method Details
-
next
public long next() -
reduceToHalf
public void reduceToHalf() -
reset
public void reset() -
shouldBackoff
public static boolean shouldBackoff(long initialTimestamp, TimeUnit unitInitial, int failedAttempts, long defaultInterval, long maxBackoffInterval) -
shouldBackoff
public static boolean shouldBackoff(long initialTimestamp, TimeUnit unitInitial, int failedAttempts)
-