Indicates a situation when execution service provided by the user in configuration rejects execution.
Convenience adapter for IComputeJob<TRes> implementations. It provides the following functionality:
This runtime exception can be thrown from Execute() method to force job failover to another node within task topology. IComputeFunc<TArg, TRes> or IComputeFunc<TRes> passed into any of the ICompute methods can also throw this exception to force failover.
Convenience adapter for IComputeTask<TArg, TJobRes, TRes> interface
This exception indicates that Ignite task was cancelled.
This attribute disables caching of task results when attached to IComputeTask<TArg, TJobRes, TRes> instance. Use it when number of jobs within task grows too big, or jobs themselves are too large to keep in memory throughout task execution. By default all results are cached and passed into OnResult(IComputeJobResult<TJobRes>, IList<IComputeJobResult<TJobRes>>) and Reduce(IList<IComputeJobResult<TJobRes>>) methods. When this attribute is attached to a task class, then this list of job results will always be empty.
This class defines simplified adapter for IComputeTask<TArg, TJobRes, TRes>. This adapter can be used when jobs can be randomly assigned to available Ignite nodes. This adapter is sufficient in most homogeneous environments where all nodes are equally suitable for executing grid job, see Split(Int32, TArg) method for more details.
Indicates that task execution timed out.
This exception is thrown when user's code throws undeclared runtime exception. By user core it is assumed the code in Ignite task, Ignite job or SPI. In most cases it should be an indication of unrecoverable error condition such as assertion, out of memory error, etc.
Note that if attempt is made to execute a computation over an empty projection (i.e. projection that does
not have any alive nodes),
ClusterGroupEmptyException will be thrown out of result task.
Ignite must select a node for a computation to be executed. The node will be selected based on the
GridLoadBalancingSpi, which by default sequentially picks next available node from
grid projection. Other load balancing policies, such as
adaptive, can be
configured as well by selecting different load balancing SPI in Ignite configuration. If your logic requires
some custom load balancing behavior, consider implementing
ComputeTask in Java directly.
Ignite guarantees that as long as there is at least one Ignite node standing, every job will be
executed. Jobs will automatically failover to another node if a remote node crashed or has rejected
execution due to lack of resources. By default, in case of failover, next load balanced node will be
picked for job execution. Also jobs will never be re-routed to the nodes they have failed on. This
behavior can be changed by configuring any of the existing or a custom
FailoverSpi in Ignite
All members are thread-safe and may be used concurrently from multiple threads.
Defines a void function having no arguments.
Defines function having no arguments.
Defines function having a single argument.
Defines executable unit for IComputeTask<TArg, TJobRes, TRes>. Ignite task gets split into jobs when Map(IList<IClusterNode>, TArg) method is called. This method returns all jobs for the task mapped to their corresponding Ignite nodes for execution. Grid will then serialize this jobs and send them to requested nodes for execution.
Once job execution is complete, the return value will be sent back to parent task and will be passed into OnResult(IComputeJobResult<TJobRes>, IList<IComputeJobResult<TJobRes>>) method via IComputeJobResult<TRes> instance.
Job execution result which gets passed to OnResult(IComputeJobResult<TJobRes>, IList<IComputeJobResult<TJobRes>>) method.
Compute reducer which is capable of result collecting and reducing.
IComputeTask without an argument.
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.
Upon request to execute a task, the system will do the following:
- Inject annotated resources into task instance.
- Apply Map(IList<IClusterNode>, TArg). 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(IComputeJobResult<TJobRes>, IList<IComputeJobResult<TJobRes>>) 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 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 Reduce is returned, reduce phase will be started right away without waiting for other jobs completion (all remaining jobs will receive cancel request).
If Failover is returned, job will be failed over to another node for execution. Note that if you use ComputeTaskAdapter<TArg, TJobRes, TTaskRes>, 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 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 Exception will return ComputeExecutionRejectedException).
- Once all results are received or OnResult(IComputeJobResult<TJobRes>, IList<IComputeJobResult<TJobRes>>) method returned Reduce policy, method Reduce(IList<IComputeJobResult<TJobRes>>) 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.
This enumeration provides different types of actions following the last received job result. See OnResult(IComputeJobResult<TJobRes>, IList<IComputeJobResult<TJobRes>>) for more details.