public interface GridComputeTaskContinuousMapper
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 GridTaskContinuousMapperResource
annotation 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;
}
| Modifier and Type | Method and Description |
|---|---|
void |
send(Collection<? extends GridComputeJob> jobs)
Sends collection of jobs to nodes automatically picked by the underlying load balancer.
|
void |
send(GridComputeJob job)
Sends job to a node automatically picked by the underlying load balancer.
|
void |
send(GridComputeJob job,
GridNode node)
Sends given job to a specific grid node.
|
void |
send(Map<? extends GridComputeJob,GridNode> mappedJobs)
Sends collection of grid jobs to assigned nodes.
|
void send(GridComputeJob job, GridNode node) throws GridException
job - Job instance to send. If null is passed, exception will be thrown.node - Grid node. If null is passed, exception will be thrown.GridException - If job can not be processed.void send(Map<? extends GridComputeJob,GridNode> mappedJobs) throws GridException
mappedJobs - Map of grid jobs assigned to grid node. If null
or empty list is passed, exception will be thrown.GridException - If job can not be processed.void send(GridComputeJob job) throws GridException
job - Job instance to send. If null is passed, exception will be thrown.GridException - If job can not be processed.void send(Collection<? extends GridComputeJob> jobs) throws GridException
jobs - Collection of grid job instances. If null or empty
list is passed, exception will be thrown.GridException - If job can not be processed.Copyright © 2014. All rights reserved.