Apache Ignite.NET
Apache.Ignite.Core.Compute.IComputeTask< in in TArg, TJobRes, out out TRes > Interface Template Reference

Ignite task interface defines a task that can be executed on the grid. Ignite task is responsible for splitting business logic into multiple Ignite jobs, receiving results from individual Ignite jobs executing on remote nodes, and reducing (aggregating) received jobs' results into final Ignite task result. More...

Detailed Description

Upon request to execute a task, the system will do the following:

  • Inject annotated resources into task instance.
  • Apply Map. This method is responsible for splitting business logic into multiple jobs (units of execution) and mapping them to Ignite nodes.
  • System will send mapped Ignite jobs to their respective nodes.
  • Once job execution results become available, OnResult method will be called for ech received job result. The policy returned by this method will determine the way task reacts to every job result.

    If ComputeJobResultPolicy.Wait is returned, task will continue to wait for other job results. If this result is the last job result, then reduce phase will be started.

    If ComputeJobResultPolicy.Reduce is returned, reduce phase will be started right away without waiting for other jobs completion (all remaining jobs will receive cancel request).

    If ComputeJobResultPolicy.Failover is returned, job will be failed over to another node for execution. Note that if you use ComputeTaskAdapter<A,T,R>, it will automatically fail jobs to another node for 2 well-known failure cases: 1) job has failed to due to node crash (in this case IComputeJobResult<T>.Exception() will return ClusterTopologyException); 2) job execution was rejected, i.e. remote node has cancelled job before it got a chance to execute, while it still was on the waiting list. (in this case IComputeJobResult<T>.Exception() will return ComputeExecutionRejectedException).

  • Once all results are received or OnResult method returned ComputeJobResultPolicy.Reduce policy, method Reduce is called to aggregate received results into one final result. Once this method is finished the execution of the Ignite task is complete. This result will be returned to the user through future.
Template Parameters
TArgArgument type.
TJobResType of job result.
TResType of final task result after reduce.