public class GridifyDefaultTask extends ComputeTaskAdapter<GridifyArgument,Object> implements org.apache.ignite.internal.util.lang.GridPeerDeployAware
Gridify documentation for more information about execution of
|Constructor and Description|
Creates gridify default task with given deployment class.
|Modifier and Type||Method and Description|
Gets class loader for the class.
Gets top level user class being deployed.
This method is called to map or split grid task into multiple grid jobs.
Reduces (or aggregates) results received so far into one compound result to be returned to caller via
public GridifyDefaultTask(Class<?> cls)
cls- Deployment class for peer-deployment.
public Class<?> deployClass()
public ClassLoader classLoader()
GridPeerDeployAware.deployClass()as well as all of its dependencies.
Note that in most cases the class loader returned from this method
and the class loader for the class returned from
will be the same. If they are not the same, it is required that the class loader
returned from this method still has to be able to load the deploy class and all its
public Map<? extends ComputeJob,ClusterNode> map(List<ClusterNode> subgrid, GridifyArgument arg)
subgrid- Nodes 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 grid nodes, the order of nodes will be random which over time should result into all nodes being used equally.
arg- Task execution argument. Can be
null. This is the same argument as the one passed into
ComputeTaskContinuousMapperis injected into task, if
nullor empty map is returned, exception will be thrown.
public final Object reduce(List<ComputeJobResult> results)
Note, that if some jobs did not succeed and could not be failed over then the list of results passed into this method will include the failed results. Otherwise, failed results will not be in the list.
results- Received results of broadcasted remote executions. Note that if task class has
ComputeTaskNoResultCacheannotation, then this list will be empty.