@InterfaceAudience.Public
@InterfaceStability.Stable
public class TotalOrderPartitioner<K,V>
extends org.apache.hadoop.mapreduce.Partitioner<K,V>
implements org.apache.hadoop.conf.Configurable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_PATH |
static java.lang.String |
MAX_TRIE_DEPTH |
static java.lang.String |
NATURAL_ORDER |
static java.lang.String |
PARTITIONER_PATH |
Constructor and Description |
---|
TotalOrderPartitioner() |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.conf.Configuration |
getConf() |
int |
getPartition(K key,
V value,
int numPartitions) |
static java.lang.String |
getPartitionFile(org.apache.hadoop.conf.Configuration conf)
Get the path to the SequenceFile storing the sorted partition keyset.
|
void |
setConf(org.apache.hadoop.conf.Configuration conf)
Read in the partition file and build indexing data structures.
|
static void |
setPartitionFile(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path p)
Set the path to the SequenceFile storing the sorted partition keyset.
|
public static final java.lang.String DEFAULT_PATH
public static final java.lang.String PARTITIONER_PATH
public static final java.lang.String MAX_TRIE_DEPTH
public static final java.lang.String NATURAL_ORDER
public void setConf(org.apache.hadoop.conf.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 JobContextImpl.getNumReduceTasks()
- 1 keys.setConf
in interface org.apache.hadoop.conf.Configurable
public org.apache.hadoop.conf.Configuration getConf()
getConf
in interface org.apache.hadoop.conf.Configurable
public static void setPartitionFile(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path p)
public static java.lang.String getPartitionFile(org.apache.hadoop.conf.Configuration conf)
setPartitionFile(Configuration, Path)