Package org.apache.ignite.compute.task
Interface MapReduceTask<I,M,T,R>
- Type Parameters:
I
- Split task (I)nput type.M
- (M)ap job input type.T
- Map job output (T)ype and reduce job input (T)ype.R
- Reduce (R)esult type.
public interface MapReduceTask<I,M,T,R>
A map reduce task interface. Implement this interface and pass a name of the implemented class to the
IgniteCompute.submitMapReduce(TaskDescriptor, Object)
method to run this task.-
Method Summary
Modifier and TypeMethodDescriptionreduceAsync
(TaskExecutionContext taskContext, Map<UUID, T> results) This is a finishing step in the task execution.default @Nullable Marshaller<R,
byte[]> The marshaller that is called to marshal reduce job result if not null.splitAsync
(TaskExecutionContext taskContext, I input) This method should return a list of compute job execution parameters which will be used to submit compute jobs.default @Nullable Marshaller<I,
byte[]> The marshaller that is called to unmarshal split job argument if not null.
-
Method Details
-
splitAsync
CompletableFuture<List<MapReduceJob<M,T>>> splitAsync(TaskExecutionContext taskContext, @Nullable I input) This method should return a list of compute job execution parameters which will be used to submit compute jobs.- Parameters:
taskContext
- Task execution context.input
- Map reduce task (I)nput.- Returns:
- A future with the list of compute job execution parameters.
-
reduceAsync
This is a finishing step in the task execution. This method will be called with the map from identifiers of compute jobs submitted as a result of thesplitAsync(TaskExecutionContext, Object)
method call to the results of the execution of the corresponding job. The resulting map has the same iteration order as the result of the split method. The return value of this method will be returned as a result of this task.- Parameters:
taskContext
- Task execution context.results
- Map from compute job ids to their results.- Returns:
- Final task result future.
-
splitJobInputMarshaller
The marshaller that is called to unmarshal split job argument if not null. -
reduceJobResultMarshaller
The marshaller that is called to marshal reduce job result if not null.
-