Package org.apache.ignite.spi
Class ExponentialBackoffTimeoutStrategy
- java.lang.Object
- 
- org.apache.ignite.spi.ExponentialBackoffTimeoutStrategy
 
- 
- All Implemented Interfaces:
- TimeoutStrategy
 
 public class ExponentialBackoffTimeoutStrategy extends Object implements TimeoutStrategy Strategy which incorporates retriable network operation, handling of totalTimeout logic. It increases startTimeout based on exponential backoff algorithm. If failure detection is enabled it relies on totalTimeout otherwise implements exponential backoff totalTimeout logic based on startTimeout, maxTimeout and retryCnt.
- 
- 
Constructor SummaryConstructors Constructor Description ExponentialBackoffTimeoutStrategy(long totalTimeout, long startTimeout, long maxTimeout)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static longbackoffTimeout(long timeout, long maxTimeout)booleancheckTimeout(long timeInFut)Check if total timeout will be reached in now() + timeInFut.longnextTimeout(long timeout)Get next timeout based on previously timeout calculated by strategy.StringtoString()static longtotalBackoffTimeout(long initTimeout, long maxTimeout, long reconCnt)Compute expected max backoff timeout based on initTimeout, maxTimeout and reconCnt and backoff coefficient.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.apache.ignite.spi.TimeoutStrategycheckTimeout, nextTimeout
 
- 
 
- 
- 
- 
Method Detail- 
totalBackoffTimeoutpublic static long totalBackoffTimeout(long initTimeout, long maxTimeout, long reconCnt)Compute expected max backoff timeout based on initTimeout, maxTimeout and reconCnt and backoff coefficient.- Parameters:
- initTimeout- Initial timeout.
- maxTimeout- Max Timeout per retry.
- reconCnt- Reconnection count.
- Returns:
- Calculated total backoff timeout.
 
 - 
backoffTimeoutpublic static long backoffTimeout(long timeout, long maxTimeout)- Parameters:
- timeout- Timeout.
- maxTimeout- Maximum startTimeout for backoff function.
- Returns:
- Next exponential backoff timeout.
 
 - 
nextTimeoutpublic long nextTimeout(long timeout) throws IgniteSpiOperationTimeoutExceptionGet next timeout based on previously timeout calculated by strategy.- Specified by:
- nextTimeoutin interface- TimeoutStrategy
- Parameters:
- timeout- Current timeout value that is used to calculate the next one.
- Returns:
- Gets next timeout.
- Throws:
- IgniteSpiOperationTimeoutException- in case of total timeout already breached.
 
 - 
checkTimeoutpublic boolean checkTimeout(long timeInFut) Check if total timeout will be reached in now() + timeInFut. If timeInFut is 0, will check that timeout already reached.- Specified by:
- checkTimeoutin interface- TimeoutStrategy
- Parameters:
- timeInFut- Some millis in future.
- Returns:
- Trueif total timeout will be reached.
 
 
- 
 
-