Created
February 3, 2011 17:14
-
-
Save noiano/809793 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TermPartitioner extends Partitioner<PairOfStringInt, PairOfWritables<Text, ArrayListOfIntsWritable>> { | |
public int getPartition(PairOfStringInt key, PairOfWritables<Text, ArrayListOfIntsWritable> value, int numPartitions) { | |
return (key.getLeftElement().hashCode() & Integer.MAX_VALUE) % numPartitions; | |
} | |
} |
Thank you for you hint but strangely the mapper produce the same output like before :(
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your partitioner should be:
For it to work with https://gist.github.com/809803