You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@hadoop.apache.org by Denim Live <de...@yahoo.com> on 2010/07/06 11:43:39 UTC

how to find the id of each map task?

Hello
I want to get the id of each mapper and reducer task because I want to tag the output of these mappers and reducers according to the mapper and reducer id. How can I retrieve the ids of each?
Thanks


      

Re: how to find the id of each map task?

Posted by welman Lu <we...@gmail.com>.
*org.apache.hadoop.mapreduce.MapContext::*getTaskAttemptID()




On Tue, Jul 6, 2010 at 11:43 AM, Denim Live <de...@yahoo.com> wrote:

>  Hello
>
> I want to get the id of each mapper and reducer task because I want to tag
> the output of these mappers and reducers according to the mapper and reducer
> id. How can I retrieve the ids of each?
>
> Thanks
>
>

Re: how to find the id of each map task?

Posted by Alexandros Konstantinakis - Karmis <ae...@ece.ntua.gr>.
On 07/06/2010 12:43 PM, Denim Live wrote:
>
> Hello
>
> I want to get the id of each mapper and reducer task because I want to 
> tag the output of these mappers and reducers according to the mapper 
> and reducer id. How can I retrieve the ids of each?
>
> Thanks
>
>
int ID = 
Integer.parseInt(context.getTaskAttemptID().toString().split("_")[4]); 
will get you at least the mapper id. i guess the reducer id will be similar