Class GridTaskWorker<T,R>
- java.lang.Object
-
- org.apache.ignite.internal.util.worker.GridWorker
-
- org.apache.ignite.internal.processors.task.GridTaskWorker<T,R>
-
- Type Parameters:
T- Task argument type.R- Task return value type.
- All Implemented Interfaces:
Runnable,GridTimeoutObject,WorkProgressDispatcher
public class GridTaskWorker<T,R> extends GridWorker implements GridTimeoutObject
Grid task worker. Handles full task life cycle.
-
-
Field Summary
-
Fields inherited from class org.apache.ignite.internal.util.worker.GridWorker
isCancelled
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringaffCacheName()intaffPartId()protected voidbody()Maps this task's jobs to nodes and sends them out.longendTime()booleanequals(Object obj)GridTaskSessionImplgetSession()ComputeTask<T,R>getTask()inthashCode()booleanisInternal()voidonTimeout()Timeout callback.voidsetTask(ComputeTask<T,R> task)IgniteUuidtimeoutId()StringtoString()-
Methods inherited from class org.apache.ignite.internal.util.worker.GridWorker
blockingSectionBegin, blockingSectionEnd, cancel, cleanup, heartbeatTs, igniteInstanceName, isCancelled, isDone, join, name, onCancel, onCancelledBeforeWorkerScheduled, onIdle, run, runner, updateHeartbeat
-
-
-
-
Method Detail
-
getSession
public GridTaskSessionImpl getSession()
- Returns:
- Task session.
-
getTask
public ComputeTask<T,R> getTask()
- Returns:
- Grid task.
-
setTask
public void setTask(ComputeTask<T,R> task)
- Parameters:
task- Deployed task.
-
isInternal
public boolean isInternal()
- Returns:
Trueif task is internal.
-
timeoutId
public IgniteUuid timeoutId()
- Specified by:
timeoutIdin interfaceGridTimeoutObject- Returns:
- ID of the object.
-
onTimeout
public void onTimeout()
Timeout callback.- Specified by:
onTimeoutin interfaceGridTimeoutObject
-
endTime
public long endTime()
- Specified by:
endTimein interfaceGridTimeoutObject- Returns:
- End time.
-
body
protected void body()
Maps this task's jobs to nodes and sends them out.- Specified by:
bodyin classGridWorker
-
affCacheName
public String affCacheName()
- Returns:
- Affinity cache name for task.
-
affPartId
public int affPartId()
- Returns:
- Affinity partition id.
-
toString
public String toString()
- Overrides:
toStringin classGridWorker
-
-