Defines a mapper that can be used for asynchronous job sending. Useful for
streaming jobs within the same task. Note that if job number within a task
grows too large, it is best to attach
GridComputeTaskNoResultCache annotation
to task to make sure that collection of job results and job siblings does
not grow indefinitely.
Continuous mapper methods can be used right after it injected into a task.
Mapper can not be used after
GridComputeTask#result(GridComputeJobResult,List)method returned the
GridComputeJobResultPolicy#REDUCE policy. Also if
GridComputeTask#result(GridComputeJobResult,List) method returned the
GridComputeJobResultPolicy#WAIT policy and all jobs are finished then task
will go to reducing results and continuous mapper can not be used.
Note that whenever continuous mapper is used,
GridComputeTask#map(List,Object)method is allowed to return
null in case when at least one job
has been sent prior to completing the
GridComputeTask#map(List,Object) method.
Task continuous mapper can be injected into a task using IoC (dependency
injection) by attaching
GridTaskContinuousMapperResourceannotation to a field or a setter method inside of
GridComputeTask implementations
as follows:
...
// This field will be injected with task continuous mapper.
@GridTaskContinuousMapperResource
private GridComputeTaskContinuousMapper mapper;
...
or from a setter method:
// This setter method will be automatically called by the system
// to set grid task continuous mapper.
@GridTaskContinuousMapperResource
void setSession(GridComputeTaskContinuousMapper mapper) {
this.mapper = mapper;
}