org.apache.hadoop.contrib.index.mapred
Class IndexUpdatePartitioner
java.lang.Object
org.apache.hadoop.contrib.index.mapred.IndexUpdatePartitioner
- All Implemented Interfaces:
- JobConfigurable, Partitioner<Shard,IntermediateForm>
public class IndexUpdatePartitioner
- extends Object
- implements Partitioner<Shard,IntermediateForm>
This partitioner class puts the values of the same key - in this case the
same shard - in the same partition.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IndexUpdatePartitioner
public IndexUpdatePartitioner()
getPartition
public int getPartition(Shard key,
IntermediateForm value,
int numPartitions)
- Description copied from interface:
Partitioner
- Get the paritition number for a given key (hence record) given the total
number of partitions i.e. number of reduce-tasks for the job.
Typically a hash function on a all or a subset of the key.
- Specified by:
getPartition
in interface Partitioner<Shard,IntermediateForm>
- Parameters:
key
- the key to be paritioned.value
- the entry value.numPartitions
- the total number of partitions.
- Returns:
- the partition number for the
key
.
configure
public void configure(JobConf job)
- Description copied from interface:
JobConfigurable
- Initializes a new instance from a
JobConf
.
- Specified by:
configure
in interface JobConfigurable
- Parameters:
job
- the configuration
Copyright © 2009 The Apache Software Foundation