Apache Ignite.NET
Apache.Ignite.Core.Compute.ComputeTaskSplitAdapter< TArg, TJobRes, TTaskRes > Class Template Referenceabstract

This class defines simplified adapter for IComputeTask<A,T,R>. 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 method for more details. More...

Inheritance diagram for Apache.Ignite.Core.Compute.ComputeTaskSplitAdapter< TArg, TJobRes, TTaskRes >:
Apache.Ignite.Core.Compute.ComputeTaskAdapter< TArg, TJobRes, TTaskRes > Apache.Ignite.Core.Compute.IComputeTask< TArg, TJobRes, TTaskRes >

Public Member Functions

override IDictionary< IComputeJob< TJobRes >, IClusterNodeMap (IList< IClusterNode > subgrid, TArg arg)
 This method is called to map or split Ignite task into multiple Ignite jobs. This is the first method that gets called when task execution starts. More...
 
- Public Member Functions inherited from Apache.Ignite.Core.Compute.ComputeTaskAdapter< TArg, TJobRes, TTaskRes >
virtual ComputeJobResultPolicy OnResult (IComputeJobResult< TJobRes > res, IList< IComputeJobResult< TJobRes >> rcvd)
 Default implementation which will wait for all jobs to complete before calling IComputeTask<A,T,R>.Reduce method. If remote job resulted in exception IComputeJobResult<T>.Exception() is not null), then ComputeJobResultPolicy.Failover policy will be returned if the exception is instance of ClusterTopologyException or ComputeExecutionRejectedException, which means that remote node either failed or job execution was rejected before it got a chance to start. In all other cases the exception will be rethrown which will ultimately cause task to fail. More...
 
abstract TTaskRes Reduce (IList< IComputeJobResult< TJobRes >> results)
 Reduces (or aggregates) results received so far into one compound result to be returned to caller via task. More...
 

Protected Member Functions

abstract ICollection< IComputeJob< TJobRes > > Split (int gridSize, TArg arg)
 This is a simplified version of IComputeTask<A,T,R>.Map method. This method basically takes given argument and splits it into a collection of IComputeJob using provided grid size as indication of how many node are available. These jobs will be randomly mapped to available Ignite nodes. Note that if number of jobs is greater than number of Ignite nodes (i.e, grid size), the grid nodes will be reused and some jobs will end up on the same Ignite nodes. More...
 

Detailed Description

Member Function Documentation

override IDictionary<IComputeJob<TJobRes>, IClusterNode> Apache.Ignite.Core.Compute.ComputeTaskSplitAdapter< TArg, TJobRes, TTaskRes >.Map ( IList< IClusterNode subgrid,
TArg  arg 
)
virtual
Parameters
subgridNodes available for this task execution. Note that order of nodes is guaranteed to be randomized by container. This ensures that every time you simply iterate through Ignite nodes, the order of nodes will be random which over time should result into all nodes being used equally.
argTask execution argument. Can be null. This is the same argument as the one passed into ICompute.Execute() methods.
Returns
Map of Ignite jobs assigned to subgrid node. If null or empty map is returned, exception will be thrown.
Exceptions
IgniteExceptionSplit returned no jobs.

Implements Apache.Ignite.Core.Compute.ComputeTaskAdapter< TArg, TJobRes, TTaskRes >.

abstract ICollection<IComputeJob<TJobRes> > Apache.Ignite.Core.Compute.ComputeTaskSplitAdapter< TArg, TJobRes, TTaskRes >.Split ( int  gridSize,
TArg  arg 
)
protectedpure virtual
Parameters
gridSizeNumber of available Ignite nodes. Note that returned number of jobs can be less, equal or greater than this grid size.
argTask execution argument. Can be null.