org.apache.hadoop.examples
Class SecondarySort.FirstPartitioner
java.lang.Object
org.apache.hadoop.mapreduce.Partitioner<SecondarySort.IntPair,IntWritable>
org.apache.hadoop.examples.SecondarySort.FirstPartitioner
- Enclosing class:
- SecondarySort
public static class SecondarySort.FirstPartitioner
- extends Partitioner<SecondarySort.IntPair,IntWritable>
Partition based on the first part of the pair.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SecondarySort.FirstPartitioner
public SecondarySort.FirstPartitioner()
getPartition
public int getPartition(SecondarySort.IntPair key,
IntWritable value,
int numPartitions)
- Description copied from class:
Partitioner
- Get the partition number for a given key (hence record) given the total
number of partitions i.e. number of reduce-tasks for the job.
Typically a hash function on a all or a subset of the key.
- Specified by:
getPartition
in class Partitioner<SecondarySort.IntPair,IntWritable>
- Parameters:
key
- 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