Class ComputePartitionQueryMapReduceExample.PersonCountByPartitionTask

java.lang.Object
org.apache.ignite.example.compute.ComputePartitionQueryMapReduceExample.PersonCountByPartitionTask
All Implemented Interfaces:
org.apache.ignite.compute.task.MapReduceTask<Void,Long,Long,Long>
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 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)
      Specified by:
      splitAsync in interface org.apache.ignite.compute.task.MapReduceTask<Void,Long,Long,Long>
    • reduceAsync

      public CompletableFuture<Long> reduceAsync(org.apache.ignite.compute.task.TaskExecutionContext taskContext, Map<UUID,Long> results)
      Specified by:
      reduceAsync in interface org.apache.ignite.compute.task.MapReduceTask<Void,Long,Long,Long>