|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.mapred.lib.TotalOrderPartitioner<K,V>
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
|
Constructor Summary | |
---|---|
TotalOrderPartitioner()
|
Method Summary | |
---|---|
void |
configure(JobConf job)
Read in the partition file and build indexing data structures. |
int |
getPartition(K key,
V value,
int numPartitions)
Get the paritition number for a given key (hence record) given the total number of partitions i.e. |
static String |
getPartitionFile(JobConf job)
Get the path to the SequenceFile storing the sorted partition keyset. |
static void |
setPartitionFile(JobConf job,
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
Constructor Detail |
---|
public TotalOrderPartitioner()
Method Detail |
---|
public void configure(JobConf job)
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 JobConf.getNumReduceTasks()
- 1 keys.
configure
in interface JobConfigurable
job
- the configurationpublic int getPartition(K key, V value, int numPartitions)
Partitioner
Typically a hash function on a all or a subset of the key.
getPartition
in interface Partitioner<K extends WritableComparable,V>
key
- the key to be paritioned.value
- the entry value.numPartitions
- the total number of partitions.
key
.public static void setPartitionFile(JobConf job, Path p)
public static String getPartitionFile(JobConf job)
setPartitionFile(JobConf,Path)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |