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 Farhan Husain <fa...@csebuet.org> on 2010/04/27 01:13:03 UTC

Reducer ID

Hello,

Is it possible to know the unique id of a reducer inside the reduce or setup
method of a reducer class? I tried to find any method of the context class
which might help in this regard but could not get any.

Thanks,
Farhan

Re: Reducer ID

Posted by Farhan Husain <fa...@csebuet.org>.
Thanks!

2010/4/26 Amareshwari Sri Ramadasu <am...@yahoo-inc.com>

> context.getTaskAttemptID() gives the task attempt id and
> context,getTaskAttemptID().getTaskID() gives the  task id of the reducer.
> Context.getTaskAttemptID().getTaskID().getId() gives the reducer number.
>
> Thanks
> Amareshwari
>
> On 4/27/10 5:34 AM, "Gang Luo" <lg...@yahoo.com.cn> wrote:
>
> JobConf.get("mapred.task.id") gives you everything (including attempt id).
>
> -Gang
>
>
> ----- 原始邮件 ----
> 发件人: Farhan Husain <fa...@csebuet.org>
> 收件人: common-user@hadoop.apache.org
> 发送日期: 2010/4/26 (周一) 7:13:03 下午
> 主   题: Reducer ID
>
> Hello,
>
> Is it possible to know the unique id of a reducer inside the reduce or
> setup
> method of a reducer class? I tried to find any method of the context class
> which might help in this regard but could not get any.
>
> Thanks,
> Farhan
>
>
>
>
>
>

Re: Reducer ID

Posted by Amareshwari Sri Ramadasu <am...@yahoo-inc.com>.
context.getTaskAttemptID() gives the task attempt id and context,getTaskAttemptID().getTaskID() gives the  task id of the reducer.
Context.getTaskAttemptID().getTaskID().getId() gives the reducer number.

Thanks
Amareshwari

On 4/27/10 5:34 AM, "Gang Luo" <lg...@yahoo.com.cn> wrote:

JobConf.get("mapred.task.id") gives you everything (including attempt id).

-Gang


----- 原始邮件 ----
发件人: Farhan Husain <fa...@csebuet.org>
收件人: common-user@hadoop.apache.org
发送日期: 2010/4/26 (周一) 7:13:03 下午
主   题: Reducer ID

Hello,

Is it possible to know the unique id of a reducer inside the reduce or setup
method of a reducer class? I tried to find any method of the context class
which might help in this regard but could not get any.

Thanks,
Farhan






Re: Reducer ID

Posted by Gang Luo <lg...@yahoo.com.cn>.
JobConf.get("mapred.task.id") gives you everything (including attempt id).

-Gang


----- 原始邮件 ----
发件人: Farhan Husain <fa...@csebuet.org>
收件人: common-user@hadoop.apache.org
发送日期: 2010/4/26 (周一) 7:13:03 下午
主   题: Reducer ID

Hello,

Is it possible to know the unique id of a reducer inside the reduce or setup
method of a reducer class? I tried to find any method of the context class
which might help in this regard but could not get any.

Thanks,
Farhan