How can I send a specific record to all my reducers ?
I know the Partitioner class and what it does, but I don't see any easy way of making sure a record goes to all the reducers.
Basically, the Partitioner has this method:
int getPartition(K2 key,
V2 value,
int numPartitions)
My first idea was to have the Partitioner and the Mapper collaborate as follows: the Mapper keeps outputting the record a number of times equal to the number of reduce tasks and the Partitioner returns all the ints (from 0 to numPartitions-1) , this way being sure the record reaches all the partitions.
Are there any other, smarter ways of solving this ? For instance I return -1 for the records that I need sent to all partitions and the framework does that for me when it sees the returned -1.