public interface ComputeTaskContinuousMapper
ComputeTaskNoResultCache
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 ComputeTask.result(ComputeJobResult, List)
method returned the ComputeJobResultPolicy.REDUCE
policy. Also if
ComputeTask.result(ComputeJobResult, List)
method returned the
ComputeJobResultPolicy.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, ComputeTask.map(List, Object)
method is allowed to return null
in case when at least one job
has been sent prior to completing the ComputeTask.map(List, Object)
method.
Task continuous mapper can be injected into a task using IoC (dependency
injection) by attaching TaskContinuousMapperResource
annotation to a field or a setter method inside of ComputeTask
implementations
as follows:
... // This field will be injected with task continuous mapper. @TaskContinuousMapperResource private ComputeTaskContinuousMapper mapper; ...or from a setter method:
// This setter method will be automatically called by the system // to set grid task continuous mapper. @TaskContinuousMapperResource void setSession(ComputeTaskContinuousMapper mapper) { this.mapper = mapper; }
Modifier and Type | Method and Description |
---|---|
void |
send(Collection<? extends ComputeJob> jobs)
Sends collection of jobs to nodes automatically picked by the underlying load balancer.
|
void |
send(ComputeJob job)
Sends job to a node automatically picked by the underlying load balancer.
|
void |
send(ComputeJob job,
ClusterNode node)
Sends given job to a specific grid node.
|
void |
send(Map<? extends ComputeJob,ClusterNode> mappedJobs)
Sends collection of grid jobs to assigned nodes.
|
void send(ComputeJob job, ClusterNode node) throws IgniteException
job
- Job instance to send. If null
is passed, exception will be thrown.node
- Grid node. If null
is passed, exception will be thrown.IgniteException
- If job can not be processed.void send(Map<? extends ComputeJob,ClusterNode> mappedJobs) throws IgniteException
mappedJobs
- Map of grid jobs assigned to grid node. If null
or empty list is passed, exception will be thrown.IgniteException
- If job can not be processed.void send(ComputeJob job) throws IgniteException
job
- Job instance to send. If null
is passed, exception will be thrown.IgniteException
- If job can not be processed.void send(Collection<? extends ComputeJob> jobs) throws IgniteException
jobs
- Collection of grid job instances. If null
or empty
list is passed, exception will be thrown.IgniteException
- If job can not be processed.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019