org.apache.mahout.utils.nlp.collocations.llr
Class GramKeyPartitioner
java.lang.Object
org.apache.mahout.utils.nlp.collocations.llr.GramKeyPartitioner
- All Implemented Interfaces:
- org.apache.hadoop.mapred.JobConfigurable, org.apache.hadoop.mapred.Partitioner<GramKey,Gram>
public class GramKeyPartitioner
- extends java.lang.Object
- implements org.apache.hadoop.mapred.Partitioner<GramKey,Gram>
Partition GramKeys based on their Gram, ignoring the secondary sort key so that all GramKeys with the same
gram are sent to the same partition.
Method Summary |
void |
configure(org.apache.hadoop.mapred.JobConf conf)
|
int |
getPartition(GramKey key,
Gram value,
int numPartitions)
|
static void |
setOffsets(org.apache.hadoop.conf.Configuration conf,
int left,
int right)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GramKeyPartitioner
public GramKeyPartitioner()
setOffsets
public static void setOffsets(org.apache.hadoop.conf.Configuration conf,
int left,
int right)
getPartition
public int getPartition(GramKey key,
Gram value,
int numPartitions)
- Specified by:
getPartition
in interface org.apache.hadoop.mapred.Partitioner<GramKey,Gram>
configure
public void configure(org.apache.hadoop.mapred.JobConf conf)
- Specified by:
configure
in interface org.apache.hadoop.mapred.JobConfigurable
Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.