KEY
- The type of the key.VALUE
- The type of the value.@InterfaceAudience.Public @InterfaceStability.Stable public class HRegionPartitioner<KEY,VALUE> extends org.apache.hadoop.mapreduce.Partitioner<ImmutableBytesWritable,VALUE> implements org.apache.hadoop.conf.Configurable
This class is not suitable as partitioner creating hfiles
for incremental bulk loads as region spread will likely change between time of
hfile creation and load time. See LoadIncrementalHFiles
and Bulk Load.
Constructor and Description |
---|
HRegionPartitioner() |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.conf.Configuration |
getConf()
Returns the current configuration.
|
int |
getPartition(ImmutableBytesWritable key,
VALUE value,
int numPartitions)
Gets the partition number for a given key (hence record) given the total
number of partitions i.e.
|
void |
setConf(org.apache.hadoop.conf.Configuration configuration)
Sets the configuration.
|
public int getPartition(ImmutableBytesWritable key, VALUE value, int numPartitions)
Typically a hash function on a all or a subset of the key.
getPartition
in class org.apache.hadoop.mapreduce.Partitioner<ImmutableBytesWritable,VALUE>
key
- The key to be partitioned.value
- The entry value.numPartitions
- The total number of partitions.key
.Partitioner.getPartition(
java.lang.Object, java.lang.Object, int)
public org.apache.hadoop.conf.Configuration getConf()
getConf
in interface org.apache.hadoop.conf.Configurable
Configurable.getConf()
public void setConf(org.apache.hadoop.conf.Configuration configuration)
setConf
in interface org.apache.hadoop.conf.Configurable
configuration
- The configuration to set.Configurable.setConf(
org.apache.hadoop.conf.Configuration)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.