Class GridTimeoutProcessor
- java.lang.Object
-
- org.apache.ignite.internal.processors.GridProcessorAdapter
-
- org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor
-
- All Implemented Interfaces:
GridComponent,GridProcessor
public class GridTimeoutProcessor extends GridProcessorAdapter
Detects timeout events and processes them.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classGridTimeoutProcessor.CancelableTask-
Nested classes/interfaces inherited from interface org.apache.ignite.internal.GridComponent
GridComponent.DiscoveryDataExchangeType
-
-
Field Summary
-
Fields inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter
ctx, diagnosticLog, log
-
-
Constructor Summary
Constructors Constructor Description GridTimeoutProcessor(GridKernalContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddTimeoutObject(GridTimeoutObject timeoutObj)voidprintMemoryStats()Prints memory statistics (sizes of internal structures, etc.).booleanremoveTimeoutObject(GridTimeoutObject timeoutObj)GridTimeoutProcessor.CancelableTaskschedule(Runnable task, long delay, long period)Schedule the specified timer task for execution at the specified time with the specified period, in milliseconds.voidstart()Starts grid component.voidstop(boolean cancel)Stops grid component.voidwaitAsync(IgniteInternalFuture<?> fut, long timeout, IgniteBiInClosure<IgniteCheckedException,Boolean> clo)Wait for a future (listen with timeout).-
Methods inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter
assertParameter, collectGridNodeData, collectJoiningNodeData, discoveryDataType, onDisconnected, onGridDataReceived, onJoiningNodeDataReceived, onKernalStart, onKernalStop, onReconnected, toString, validateNode, validateNode
-
-
-
-
Constructor Detail
-
GridTimeoutProcessor
public GridTimeoutProcessor(GridKernalContext ctx)
- Parameters:
ctx- Kernal context.
-
-
Method Detail
-
start
public void start()
Starts grid component.- Specified by:
startin interfaceGridComponent- Overrides:
startin classGridProcessorAdapter
-
stop
public void stop(boolean cancel) throws IgniteCheckedExceptionStops grid component.- Specified by:
stopin interfaceGridComponent- Overrides:
stopin classGridProcessorAdapter- Parameters:
cancel- Iftrue, then all ongoing tasks or jobs for relevant components need to be cancelled.- Throws:
IgniteCheckedException- Thrown in case of any errors.
-
addTimeoutObject
public boolean addTimeoutObject(GridTimeoutObject timeoutObj)
- Parameters:
timeoutObj- Timeout object.- Returns:
Trueif object was added.
-
schedule
public GridTimeoutProcessor.CancelableTask schedule(Runnable task, long delay, long period)
Schedule the specified timer task for execution at the specified time with the specified period, in milliseconds.- Parameters:
task- Task to execute.delay- Delay to first execution in milliseconds.period- Period for execution in milliseconds or -1.- Returns:
- Cancelable to cancel task.
-
removeTimeoutObject
public boolean removeTimeoutObject(GridTimeoutObject timeoutObj)
- Parameters:
timeoutObj- Timeout object.- Returns:
Trueif timeout object was removed.
-
waitAsync
public void waitAsync(IgniteInternalFuture<?> fut, long timeout, IgniteBiInClosure<IgniteCheckedException,Boolean> clo)
Wait for a future (listen with timeout).- Parameters:
fut- Future.timeout- Timeout millis. -1 means expired timeout, 0 means waiting without timeout.clo- Finish closure. First argument contains error on future or null if no errors, second istrueif wait timed out or passed timeout argument means expired timeout.
-
printMemoryStats
public void printMemoryStats()
Prints memory statistics (sizes of internal structures, etc.). NOTE: this method is for testing and profiling purposes only.- Specified by:
printMemoryStatsin interfaceGridComponent- Overrides:
printMemoryStatsin classGridProcessorAdapter
-
-