Class ComputePartitionQueryMapReduceExample.PersonCountByPartitionTask
java.lang.Object
org.apache.ignite.example.compute.ComputePartitionQueryMapReduceExample.PersonCountByPartitionTask
- Enclosing class:
- ComputePartitionQueryMapReduceExample
public static class ComputePartitionQueryMapReduceExample.PersonCountByPartitionTask
extends Object
implements org.apache.ignite.compute.task.MapReduceTask<Void,Long,Long,Long>
MapReduce task that counts persons across all partitions of the
Person table.
The split phase uses PartitionDistribution.primaryReplicas() to get the current primary replica node
for each partition, then creates one ComputePartitionQueryMapReduceExample.PartitionPersonCountJob per partition targeted at that node.
The reduce phase sums the per-partition counts.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreduceAsync(org.apache.ignite.compute.task.TaskExecutionContext taskContext, Map<UUID, Long> results) CompletableFuture<List<org.apache.ignite.compute.task.MapReduceJob<Long,Long>>> splitAsync(org.apache.ignite.compute.task.TaskExecutionContext taskContext, Void input) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.ignite.compute.task.MapReduceTask
reduceJobResultMarshaller, splitJobInputMarshaller
-
Constructor Details
-
PersonCountByPartitionTask
public PersonCountByPartitionTask()
-
-
Method Details
-
splitAsync
public CompletableFuture<List<org.apache.ignite.compute.task.MapReduceJob<Long,Long>>> splitAsync(org.apache.ignite.compute.task.TaskExecutionContext taskContext, Void input) -
reduceAsync
public CompletableFuture<Long> reduceAsync(org.apache.ignite.compute.task.TaskExecutionContext taskContext, Map<UUID, Long> results)
-