Package org.infinispan.util
Class ExponentialBackOffImpl
- java.lang.Object
-
- org.infinispan.util.ExponentialBackOffImpl
-
- All Implemented Interfaces:
ExponentialBackOff
public class ExponentialBackOffImpl extends Object implements ExponentialBackOff
The defaultExponentialBackOffimplementation for IRAC (asynchronous cross-site replication).An exponential back-off implementation with min interval of 500 ms and a maximum of 300'000 ms (5 min). It uses a multiplier of 2 (each timeslot will be increase + 100% for each consecutive retry) and the final wait time is randomized, +- 50% of the timeslot.
- Since:
- 12.0
- Author:
- Pedro Ruivo
-
-
Field Summary
-
Fields inherited from interface org.infinispan.util.ExponentialBackOff
NO_OP
-
-
Constructor Summary
Constructors Constructor Description ExponentialBackOffImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbackoffSleep()It blocks the thread for a certain amount of time before retries the request.voidreset()Resets its state.
-
-
-
Method Detail
-
backoffSleep
public void backoffSleep() throws InterruptedExceptionDescription copied from interface:ExponentialBackOffIt blocks the thread for a certain amount of time before retries the request.The method is blocking and should be invoked when a request needs to be retried. It blocks the thread for a certain amount of time until it is allowed to do the request again.
- Specified by:
backoffSleepin interfaceExponentialBackOff- Throws:
InterruptedException- If theThreadis interrupted while blocked.
-
reset
public void reset()
Description copied from interface:ExponentialBackOffResets its state.The blocking time in
ExponentialBackOff.backoffSleep()increases with the number of consecutive retries. This methods resets its state back to the initial sleep time.- Specified by:
resetin interfaceExponentialBackOff
-
-