org.apache.hadoop.examples.pi
Class DistSum.ReduceSide.IndexPartitioner
java.lang.Object
org.apache.hadoop.mapreduce.Partitioner<org.apache.hadoop.io.IntWritable,SummationWritable>
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.
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 |
DistSum.ReduceSide.IndexPartitioner
public DistSum.ReduceSide.IndexPartitioner()
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