public class SingleFieldHashPartitionFunction extends PartitionFunction<java.lang.String,java.lang.String>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FIELD_NAME |
private java.lang.String |
fieldName |
private static long |
serialVersionUID |
attributes, numPartition| Constructor and Description |
|---|
SingleFieldHashPartitionFunction(int numPartition) |
| Modifier and Type | Method and Description |
|---|---|
int |
partition(Tuple t,
TupleDesc td)
Given an input tuple t, determine which partition to route it to.
|
void |
setAttribute(java.lang.String attribute,
java.lang.String value)
This partition function only needs the index of the
partition field in deciding the tuple partitions
|
getAttribute, numPartitionprivate static final long serialVersionUID
public static final java.lang.String FIELD_NAME
private java.lang.String fieldName
public SingleFieldHashPartitionFunction(int numPartition)
public void setAttribute(java.lang.String attribute,
java.lang.String value)
setAttribute in class PartitionFunction<java.lang.String,java.lang.String>public int partition(Tuple t, TupleDesc td)
PartitionFunctionpartition in class PartitionFunction<java.lang.String,java.lang.String>t - the input tuple to route.td - the tuple descriptor of the input tuple. Must have non-null
names for those attributes that are used to compute the worker
to route to.