public class ExponentialBackoffTimeoutStrategy extends Object implements TimeoutStrategy
Constructor and Description |
---|
ExponentialBackoffTimeoutStrategy(long totalTimeout,
long startTimeout,
long maxTimeout) |
Modifier and Type | Method and Description |
---|---|
static long |
backoffTimeout(long timeout,
long maxTimeout) |
boolean |
checkTimeout(long timeInFut)
Check if total timeout will be reached in now() + timeInFut.
|
long |
nextTimeout(long timeout)
Get next timeout based on previously timeout calculated by strategy.
|
String |
toString() |
static long |
totalBackoffTimeout(long initTimeout,
long maxTimeout,
long reconCnt)
Compute expected max backoff timeout based on initTimeout, maxTimeout and reconCnt and backoff coefficient.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
checkTimeout, nextTimeout
public ExponentialBackoffTimeoutStrategy(long totalTimeout, long startTimeout, long maxTimeout)
totalTimeout
- Total startTimeout.startTimeout
- Initial connection timeout.maxTimeout
- Max connection Timeout.public static long totalBackoffTimeout(long initTimeout, long maxTimeout, long reconCnt)
initTimeout
- Initial timeout.maxTimeout
- Max Timeout per retry.reconCnt
- Reconnection count.public static long backoffTimeout(long timeout, long maxTimeout)
timeout
- Timeout.maxTimeout
- Maximum startTimeout for backoff function.public long nextTimeout(long timeout) throws IgniteSpiOperationTimeoutException
nextTimeout
in interface TimeoutStrategy
timeout
- Current timeout value that is used to calculate the next one.IgniteSpiOperationTimeoutException
- in case of total timeout already breached.public boolean checkTimeout(long timeInFut)
checkTimeout
in interface TimeoutStrategy
timeInFut
- Some millis in future.True
if total timeout will be reached.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023