public class Backoff extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_INTERVAL_IN_NANOSECONDS |
static long |
MAX_BACKOFF_INTERVAL_NANOSECONDS |
| Constructor and Description |
|---|
Backoff(long initial,
TimeUnit unitInitial,
long max,
TimeUnit unitMax,
long mandatoryStop,
TimeUnit unitMandatoryStop) |
| Modifier and Type | Method and Description |
|---|---|
long |
next() |
void |
reduceToHalf() |
void |
reset() |
static boolean |
shouldBackoff(long initialTimestamp,
TimeUnit unitInitial,
int failedAttempts) |
static boolean |
shouldBackoff(long initialTimestamp,
TimeUnit unitInitial,
int failedAttempts,
long defaultInterval,
long maxBackoffInterval) |
public static final long DEFAULT_INTERVAL_IN_NANOSECONDS
public static final long MAX_BACKOFF_INTERVAL_NANOSECONDS
public long next()
public void reduceToHalf()
public void reset()
public static boolean shouldBackoff(long initialTimestamp,
TimeUnit unitInitial,
int failedAttempts,
long defaultInterval,
long maxBackoffInterval)
public static boolean shouldBackoff(long initialTimestamp,
TimeUnit unitInitial,
int failedAttempts)
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.