You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by abc xyz <fa...@yahoo.com> on 2010/07/08 10:56:20 UTC

getting the partition number in a reducer to which a key-value pair belongs

Hello everyone,
when i am processing a given key-{set of values} pair in reducer function, how 
can I get the partition number to which this key-{set of values} belong to? How 
is it possible to get this partition number without adding extra information 
about the partition number with each key-value pair during partitioning?
Cheers



      

Re: getting the partition number in a reducer to which a key-value pair belongs

Posted by abc xyz <fa...@yahoo.com>.
This has worked for me:
jobconf.getInt( "mapred.task.partition",  0);
in the reducer.





________________________________
From: abc xyz <fa...@yahoo.com>
To: common-user@hadoop.apache.org
Cc: general@hadoop.apache.org
Sent: Thu, July 8, 2010 9:56:20 AM
Subject: getting the partition number in a reducer to which a key-value pair 
belongs

Hello everyone,
when i am processing a given key-{set of values} pair in reducer function, how 
can I get the partition number to which this key-{set of values} belong to? How 
is it possible to get this partition number without adding extra information 
about the partition number with each key-value pair during partitioning?
Cheers


      

Re: getting the partition number in a reducer to which a key-value pair belongs

Posted by abc xyz <fa...@yahoo.com>.
This has worked for me:
jobconf.getInt( "mapred.task.partition", 0);
in the reducer.




________________________________
From: abc xyz <fa...@yahoo.com>
To: common-user@hadoop.apache.org
Cc: general@hadoop.apache.org
Sent: Thu, July 8, 2010 9:56:20 AM
Subject: getting the partition number in a reducer to which a key-value pair 
belongs

Hello everyone,
when i am processing a given key-{set of values} pair in reducer function, how 
can I get the partition number to which this key-{set of values} belong to? How 
is it possible to get this partition number without adding extra information 
about the partition number with each key-value pair during partitioning?
Cheers