public class TablePartitioner
extends org.apache.hadoop.mapreduce.Partitioner<ByteBufWritableComparable,org.ojai.Document>
implements org.apache.hadoop.conf.Configurable
TablePartitioner controls the partitioning of key space of a JSON
table for intermediate map-out functions. The key/id is used to derive the partition.
| Constructor and Description |
|---|
TablePartitioner() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.hadoop.conf.Configuration |
getConf()
Returns the current configuration.
|
int |
getPartition(ByteBufWritableComparable key,
org.ojai.Document 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(ByteBufWritableComparable key,
org.ojai.Document value,
int numPartitions)
Typically a hash function on a all or a subset of the key.
getPartition in class org.apache.hadoop.mapreduce.Partitioner<ByteBufWritableComparable,org.ojai.Document>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.ConfigurableConfigurable.getConf()public void setConf(org.apache.hadoop.conf.Configuration configuration)
setConf in interface org.apache.hadoop.conf.Configurableconfiguration - The configuration to set.Configurable.setConf(
org.apache.hadoop.conf.Configuration)