Package org.apache.ignite.spi
Class IgniteSpiOperationTimeoutHelper
- java.lang.Object
- 
- org.apache.ignite.spi.IgniteSpiOperationTimeoutHelper
 
- 
 public class IgniteSpiOperationTimeoutHelper extends Object Object that incorporates logic that determines a timeout value for the next network related operation and checks whether a failure detection timeout is reached or not. A new instance of the class should be created for every complex network based operations that usually consists of request and response parts.
- 
- 
Constructor SummaryConstructors Constructor Description IgniteSpiOperationTimeoutHelper(long timeout)Creates timeout helper with an absolute time threshold.IgniteSpiOperationTimeoutHelper(IgniteSpiAdapter adapter, boolean srvOp)Constructor.IgniteSpiOperationTimeoutHelper(IgniteSpiAdapter adapter, boolean srvOp, long lastRelatedOperationTime, long absoluteThreshold)Creates timeout helper based on time of last related operation.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleancheckFailureTimeoutReached(Exception e)Checks whether the givenExceptionis a timeout.longnextTimeoutChunk(long dfltTimeout)Returns a timeout value to use for the next network operation.
 
- 
- 
- 
Constructor Detail- 
IgniteSpiOperationTimeoutHelperpublic IgniteSpiOperationTimeoutHelper(IgniteSpiAdapter adapter, boolean srvOp) Constructor.- Parameters:
- adapter- SPI adapter.
- srvOp-- Trueif communicates with server node.
 
 - 
IgniteSpiOperationTimeoutHelperpublic IgniteSpiOperationTimeoutHelper(IgniteSpiAdapter adapter, boolean srvOp, long lastRelatedOperationTime, long absoluteThreshold) Creates timeout helper based on time of last related operation.- Parameters:
- adapter- SPI adapter.
- srvOp-- Trueif communicates with server node.
- lastRelatedOperationTime- Time of last related operation in nanos. Ignored if negative, 0 or- adapter.failureDetectionTimeoutEnabled()is false.
- absoluteThreshold- Absolute time threshold (nanos) which must not be reached. Ignored if negative or 0.
 
 - 
IgniteSpiOperationTimeoutHelperpublic IgniteSpiOperationTimeoutHelper(long timeout) Creates timeout helper with an absolute time threshold. SetstimeoutEnabledtofalse.- Parameters:
- timeout- Timeout in milliseconds.
 
 
- 
 - 
Method Detail- 
nextTimeoutChunkpublic long nextTimeoutChunk(long dfltTimeout) throws IgniteSpiOperationTimeoutExceptionReturns a timeout value to use for the next network operation. If failure detection timeout is enabled then the returned value is a portion of time left since the last time this method is called. If the timeout is disabled thendfltTimeoutis returned.- Parameters:
- dfltTimeout- Timeout to use if failure detection timeout is disabled.
- Returns:
- Timeout in milliseconds.
- Throws:
- IgniteSpiOperationTimeoutException- If failure detection timeout is reached for an operation that uses this- IgniteSpiOperationTimeoutController.
 
 
- 
 
-