|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.mapreduce.Partitioner<K,V>
org.apache.hadoop.mapreduce.lib.partition.TotalOrderPartitioner<K,V>
@InterfaceAudience.Public @InterfaceStability.Stable public class TotalOrderPartitioner<K extends WritableComparable<?>,V>
Partitioner effecting a total order by reading split points from an externally generated source.
| Field Summary | |
|---|---|
static String |
DEFAULT_PATH
|
static String |
MAX_TRIE_DEPTH
|
static String |
NATURAL_ORDER
|
static String |
PARTITIONER_PATH
|
| Constructor Summary | |
|---|---|
TotalOrderPartitioner()
|
|
| Method Summary | |
|---|---|
Configuration |
getConf()
Return the configuration used by this object. |
int |
getPartition(K key,
V value,
int numPartitions)
Get the partition number for a given key (hence record) given the total number of partitions i.e. |
static String |
getPartitionFile(Configuration conf)
Get the path to the SequenceFile storing the sorted partition keyset. |
void |
setConf(Configuration conf)
Read in the partition file and build indexing data structures. |
static void |
setPartitionFile(Configuration conf,
Path p)
Set the path to the SequenceFile storing the sorted partition keyset. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_PATH
public static final String PARTITIONER_PATH
public static final String MAX_TRIE_DEPTH
public static final String NATURAL_ORDER
| Constructor Detail |
|---|
public TotalOrderPartitioner()
| Method Detail |
|---|
public void setConf(Configuration conf)
BinaryComparable and
total.order.partitioner.natural.order is not false, a trie
of the first total.order.partitioner.max.trie.depth(2) + 1 bytes
will be built. Otherwise, keys will be located using a binary search of
the partition keyset using the RawComparator
defined for this job. The input file must be sorted with the same
comparator and contain JobContext.getNumReduceTasks() - 1 keys.
setConf in interface Configurablepublic Configuration getConf()
Configurable
getConf in interface Configurable
public int getPartition(K key,
V value,
int numPartitions)
PartitionerTypically a hash function on a all or a subset of the key.
getPartition in class Partitioner<K extends WritableComparable<?>,V>key - the key to be partioned.value - the entry value.numPartitions - the total number of partitions.
key.
public static void setPartitionFile(Configuration conf,
Path p)
public static String getPartitionFile(Configuration conf)
setPartitionFile(Configuration, Path)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||