public class WeightedRangePartitioner extends org.apache.hadoop.mapreduce.Partitioner<PigNullableWritable,org.apache.hadoop.io.Writable> implements org.apache.hadoop.conf.Configurable
Modifier and Type | Field and Description |
---|---|
protected org.apache.hadoop.io.RawComparator<PigNullableWritable> |
comparator |
protected boolean |
inited |
protected org.apache.hadoop.conf.Configuration |
job |
protected PigNullableWritable[] |
quantiles |
protected Map<PigNullableWritable,DiscreteProbabilitySampleGenerator> |
weightedParts |
Constructor and Description |
---|
WeightedRangePartitioner() |
Modifier and Type | Method and Description |
---|---|
protected void |
convertToArray(DataBag quantilesListAsBag) |
org.apache.hadoop.conf.Configuration |
getConf() |
int |
getPartition(PigNullableWritable key,
org.apache.hadoop.io.Writable value,
int numPartitions) |
protected PigNullableWritable |
getPigNullableWritable(Tuple t) |
protected float[] |
getProbVec(Tuple values) |
void |
init() |
void |
setConf(org.apache.hadoop.conf.Configuration configuration) |
protected Map<PigNullableWritable,DiscreteProbabilitySampleGenerator> weightedParts
protected PigNullableWritable[] quantiles
protected org.apache.hadoop.io.RawComparator<PigNullableWritable> comparator
protected org.apache.hadoop.conf.Configuration job
protected boolean inited
public int getPartition(PigNullableWritable key, org.apache.hadoop.io.Writable value, int numPartitions)
getPartition
in class org.apache.hadoop.mapreduce.Partitioner<PigNullableWritable,org.apache.hadoop.io.Writable>
public void init()
public void setConf(org.apache.hadoop.conf.Configuration configuration)
setConf
in interface org.apache.hadoop.conf.Configurable
protected float[] getProbVec(Tuple values) throws ExecException
value
- ExecException
protected PigNullableWritable getPigNullableWritable(Tuple t)
protected void convertToArray(DataBag quantilesListAsBag)
public org.apache.hadoop.conf.Configuration getConf()
getConf
in interface org.apache.hadoop.conf.Configurable
Copyright © 2007-2017 The Apache Software Foundation