MAPREDUCE-3139. SlivePartitioner generates negative partitions.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1196776 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a4baabe4a4
commit
201a18de0c
|
@ -2506,6 +2506,8 @@ Release 0.22.0 - Unreleased
|
||||||
MAPREDUCE-2531. Fixed jobcontrol to downgrade JobID. (Robert Evans via
|
MAPREDUCE-2531. Fixed jobcontrol to downgrade JobID. (Robert Evans via
|
||||||
acmurthy)
|
acmurthy)
|
||||||
|
|
||||||
|
MAPREDUCE-3139. SlivePartitioner generates negative partitions. (jghoman)
|
||||||
|
|
||||||
Release 0.21.1 - Unreleased
|
Release 0.21.1 - Unreleased
|
||||||
|
|
||||||
NEW FEATURES
|
NEW FEATURES
|
||||||
|
|
|
@ -34,6 +34,6 @@ public class SlivePartitioner implements Partitioner<Text, Text> {
|
||||||
@Override // Partitioner
|
@Override // Partitioner
|
||||||
public int getPartition(Text key, Text value, int numPartitions) {
|
public int getPartition(Text key, Text value, int numPartitions) {
|
||||||
OperationOutput oo = new OperationOutput(key, value);
|
OperationOutput oo = new OperationOutput(key, value);
|
||||||
return oo.getOperationType().hashCode() % numPartitions;
|
return (oo.getOperationType().hashCode() & Integer.MAX_VALUE) % numPartitions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue