org.apache.hadoop.examples.pi
Class DistSum.ReduceSide.IndexPartitioner

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Partitioner<org.apache.hadoop.io.IntWritable,SummationWritable>
      extended by org.apache.hadoop.examples.pi.DistSum.ReduceSide.IndexPartitioner
Enclosing class:
DistSum.ReduceSide

public static class DistSum.ReduceSide.IndexPartitioner
extends Partitioner<org.apache.hadoop.io.IntWritable,SummationWritable>

Use the index for partitioning.


Constructor Summary
DistSum.ReduceSide.IndexPartitioner()
           
 
Method Summary
 int getPartition(org.apache.hadoop.io.IntWritable index, SummationWritable value, int numPartitions)
          Return the index as the partition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistSum.ReduceSide.IndexPartitioner

public DistSum.ReduceSide.IndexPartitioner()
Method Detail

getPartition

public int getPartition(org.apache.hadoop.io.IntWritable index,
                        SummationWritable value,
                        int numPartitions)
Return the index as the partition.

Specified by:
getPartition in class Partitioner<org.apache.hadoop.io.IntWritable,SummationWritable>
Parameters:
index - the key to be partioned.
value - the entry value.
numPartitions - the total number of partitions.
Returns:
the partition number for the key.


Copyright © 2009 The Apache Software Foundation