HashPartitioner (Hadoop 0.20.2-cdh3u4 API)
Date: 2012-05-07

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.hadoop.mapreduce.lib.partition
Class HashPartitioner<K,V>

    java.lang.Object
      org.apache.hadoop.mapreduce.Partitioner<K,V>
          org.apache.hadoop.mapreduce.lib.partition.HashPartitioner<K,V>

    public class HashPartitioner<K,V>

extends Partitioner<K,V>

Partition keys by their `Object.hashCode()`.

Constructor Summary
`HashPartitioner()`

Method Summary
`int` | `getPartition(K key, V value, int numReduceTasks)` Use `Object.hashCode()` to partition.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### HashPartitioner

    public HashPartitioner()

Method Detail

### getPartition

    public int getPartition(K key,
                            V value,
                            int numReduceTasks)

  Use `Object.hashCode()` to partition.

  Specified by:
    `getPartition` in class `Partitioner<K,V>`
  Parameters:
    `key` - the key to be partioned.
    `value` - the entry value.
    `numReduceTasks` - the total number of partitions.
  Returns:
    the partition number for the `key`.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 The Apache Software Foundation