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 Bharati <bh...@mparallelo.com> on 2013/04/25 17:45:26 UTC

TaskID

Hi Folks,

I need to find the task ID of the map task. 
Please send me any ideas or suggestions.

Thanks,
Bharati

Sent from my iPad

Re: TaskID

Posted by Bharati <bh...@mparallelo.com>.
Thanks,
I will try it and let you know if I run into problems. 

Sent from my iPhone

On Apr 25, 2013, at 9:20 AM, Chris Nauroth <cn...@hortonworks.com> wrote:

> Hi Bharati,
> 
> Your mapper class implementation methods have access to a MapContext:
> 
> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/MapContext.html
> 
> This is a subclass of TaskAttemptContext:
> 
> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/TaskAttemptContext.html
> 
> You can use the TaskAttemptContext to call getTaskAttemptId and retrieve a TaskAttemptID object:
> 
> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/TaskAttemptID.html
> 
> A task attempt ID consists of the task ID + an attempt number.  Note that task ID alone is not guaranteed to be unique across execution of the whole job.  Due to speculative execution or transient task failures, multiple attempts of the same task can run, and they'll all have the same task ID.  The task ID + attempt number is guaranteed to be unique within the job.
> 
> BTW, it's pretty much the same process for a reducer too, except you're working with a ReduceContext instead of a MapContext.
> 
> Hope this helps,
> --Chris
> 
> 
> 
> 
> 
> 
> 
> On Thu, Apr 25, 2013 at 8:45 AM, Bharati <bh...@mparallelo.com> wrote:
>> Hi Folks,
>> 
>> I need to find the task ID of the map task.
>> Please send me any ideas or suggestions.
>> 
>> Thanks,
>> Bharati
>> 
>> Sent from my iPad
>> 
>> Fortigate Filtered
> 

Re: TaskID

Posted by Bharati <bh...@mparallelo.com>.
Thanks,
I will try it and let you know if I run into problems. 

Sent from my iPhone

On Apr 25, 2013, at 9:20 AM, Chris Nauroth <cn...@hortonworks.com> wrote:

> Hi Bharati,
> 
> Your mapper class implementation methods have access to a MapContext:
> 
> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/MapContext.html
> 
> This is a subclass of TaskAttemptContext:
> 
> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/TaskAttemptContext.html
> 
> You can use the TaskAttemptContext to call getTaskAttemptId and retrieve a TaskAttemptID object:
> 
> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/TaskAttemptID.html
> 
> A task attempt ID consists of the task ID + an attempt number.  Note that task ID alone is not guaranteed to be unique across execution of the whole job.  Due to speculative execution or transient task failures, multiple attempts of the same task can run, and they'll all have the same task ID.  The task ID + attempt number is guaranteed to be unique within the job.
> 
> BTW, it's pretty much the same process for a reducer too, except you're working with a ReduceContext instead of a MapContext.
> 
> Hope this helps,
> --Chris
> 
> 
> 
> 
> 
> 
> 
> On Thu, Apr 25, 2013 at 8:45 AM, Bharati <bh...@mparallelo.com> wrote:
>> Hi Folks,
>> 
>> I need to find the task ID of the map task.
>> Please send me any ideas or suggestions.
>> 
>> Thanks,
>> Bharati
>> 
>> Sent from my iPad
>> 
>> Fortigate Filtered
> 

Re: TaskID

Posted by Bharati <bh...@mparallelo.com>.
Thanks,
I will try it and let you know if I run into problems. 

Sent from my iPhone

On Apr 25, 2013, at 9:20 AM, Chris Nauroth <cn...@hortonworks.com> wrote:

> Hi Bharati,
> 
> Your mapper class implementation methods have access to a MapContext:
> 
> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/MapContext.html
> 
> This is a subclass of TaskAttemptContext:
> 
> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/TaskAttemptContext.html
> 
> You can use the TaskAttemptContext to call getTaskAttemptId and retrieve a TaskAttemptID object:
> 
> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/TaskAttemptID.html
> 
> A task attempt ID consists of the task ID + an attempt number.  Note that task ID alone is not guaranteed to be unique across execution of the whole job.  Due to speculative execution or transient task failures, multiple attempts of the same task can run, and they'll all have the same task ID.  The task ID + attempt number is guaranteed to be unique within the job.
> 
> BTW, it's pretty much the same process for a reducer too, except you're working with a ReduceContext instead of a MapContext.
> 
> Hope this helps,
> --Chris
> 
> 
> 
> 
> 
> 
> 
> On Thu, Apr 25, 2013 at 8:45 AM, Bharati <bh...@mparallelo.com> wrote:
>> Hi Folks,
>> 
>> I need to find the task ID of the map task.
>> Please send me any ideas or suggestions.
>> 
>> Thanks,
>> Bharati
>> 
>> Sent from my iPad
>> 
>> Fortigate Filtered
> 

Re: TaskID

Posted by Bharati <bh...@mparallelo.com>.
Thanks,
I will try it and let you know if I run into problems. 

Sent from my iPhone

On Apr 25, 2013, at 9:20 AM, Chris Nauroth <cn...@hortonworks.com> wrote:

> Hi Bharati,
> 
> Your mapper class implementation methods have access to a MapContext:
> 
> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/MapContext.html
> 
> This is a subclass of TaskAttemptContext:
> 
> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/TaskAttemptContext.html
> 
> You can use the TaskAttemptContext to call getTaskAttemptId and retrieve a TaskAttemptID object:
> 
> http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/TaskAttemptID.html
> 
> A task attempt ID consists of the task ID + an attempt number.  Note that task ID alone is not guaranteed to be unique across execution of the whole job.  Due to speculative execution or transient task failures, multiple attempts of the same task can run, and they'll all have the same task ID.  The task ID + attempt number is guaranteed to be unique within the job.
> 
> BTW, it's pretty much the same process for a reducer too, except you're working with a ReduceContext instead of a MapContext.
> 
> Hope this helps,
> --Chris
> 
> 
> 
> 
> 
> 
> 
> On Thu, Apr 25, 2013 at 8:45 AM, Bharati <bh...@mparallelo.com> wrote:
>> Hi Folks,
>> 
>> I need to find the task ID of the map task.
>> Please send me any ideas or suggestions.
>> 
>> Thanks,
>> Bharati
>> 
>> Sent from my iPad
>> 
>> Fortigate Filtered
> 

Re: TaskID

Posted by Chris Nauroth <cn...@hortonworks.com>.
Hi Bharati,

Your mapper class implementation methods have access to a MapContext:

http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/MapContext.html

This is a subclass of TaskAttemptContext:

http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/TaskAttemptContext.html

You can use the TaskAttemptContext to call getTaskAttemptId and retrieve a
TaskAttemptID object:

http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/TaskAttemptID.html

A task attempt ID consists of the task ID + an attempt number.  Note that
task ID alone is not guaranteed to be unique across execution of the whole
job.  Due to speculative execution or transient task failures, multiple
attempts of the same task can run, and they'll all have the same task ID.
 The task ID + attempt number is guaranteed to be unique within the job.

BTW, it's pretty much the same process for a reducer too, except you're
working with a ReduceContext instead of a MapContext.

Hope this helps,
--Chris







On Thu, Apr 25, 2013 at 8:45 AM, Bharati <bh...@mparallelo.com>wrote:

> Hi Folks,
>
> I need to find the task ID of the map task.
> Please send me any ideas or suggestions.
>
> Thanks,
> Bharati
>
> Sent from my iPad
>
> Fortigate Filtered
>
>

Re: TaskID

Posted by Chris Nauroth <cn...@hortonworks.com>.
Hi Bharati,

Your mapper class implementation methods have access to a MapContext:

http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/MapContext.html

This is a subclass of TaskAttemptContext:

http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/TaskAttemptContext.html

You can use the TaskAttemptContext to call getTaskAttemptId and retrieve a
TaskAttemptID object:

http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/TaskAttemptID.html

A task attempt ID consists of the task ID + an attempt number.  Note that
task ID alone is not guaranteed to be unique across execution of the whole
job.  Due to speculative execution or transient task failures, multiple
attempts of the same task can run, and they'll all have the same task ID.
 The task ID + attempt number is guaranteed to be unique within the job.

BTW, it's pretty much the same process for a reducer too, except you're
working with a ReduceContext instead of a MapContext.

Hope this helps,
--Chris







On Thu, Apr 25, 2013 at 8:45 AM, Bharati <bh...@mparallelo.com>wrote:

> Hi Folks,
>
> I need to find the task ID of the map task.
> Please send me any ideas or suggestions.
>
> Thanks,
> Bharati
>
> Sent from my iPad
>
> Fortigate Filtered
>
>

Re: TaskID

Posted by Chris Nauroth <cn...@hortonworks.com>.
Hi Bharati,

Your mapper class implementation methods have access to a MapContext:

http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/MapContext.html

This is a subclass of TaskAttemptContext:

http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/TaskAttemptContext.html

You can use the TaskAttemptContext to call getTaskAttemptId and retrieve a
TaskAttemptID object:

http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/TaskAttemptID.html

A task attempt ID consists of the task ID + an attempt number.  Note that
task ID alone is not guaranteed to be unique across execution of the whole
job.  Due to speculative execution or transient task failures, multiple
attempts of the same task can run, and they'll all have the same task ID.
 The task ID + attempt number is guaranteed to be unique within the job.

BTW, it's pretty much the same process for a reducer too, except you're
working with a ReduceContext instead of a MapContext.

Hope this helps,
--Chris







On Thu, Apr 25, 2013 at 8:45 AM, Bharati <bh...@mparallelo.com>wrote:

> Hi Folks,
>
> I need to find the task ID of the map task.
> Please send me any ideas or suggestions.
>
> Thanks,
> Bharati
>
> Sent from my iPad
>
> Fortigate Filtered
>
>

Re: TaskID

Posted by Chris Nauroth <cn...@hortonworks.com>.
Hi Bharati,

Your mapper class implementation methods have access to a MapContext:

http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/MapContext.html

This is a subclass of TaskAttemptContext:

http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/TaskAttemptContext.html

You can use the TaskAttemptContext to call getTaskAttemptId and retrieve a
TaskAttemptID object:

http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/TaskAttemptID.html

A task attempt ID consists of the task ID + an attempt number.  Note that
task ID alone is not guaranteed to be unique across execution of the whole
job.  Due to speculative execution or transient task failures, multiple
attempts of the same task can run, and they'll all have the same task ID.
 The task ID + attempt number is guaranteed to be unique within the job.

BTW, it's pretty much the same process for a reducer too, except you're
working with a ReduceContext instead of a MapContext.

Hope this helps,
--Chris







On Thu, Apr 25, 2013 at 8:45 AM, Bharati <bh...@mparallelo.com>wrote:

> Hi Folks,
>
> I need to find the task ID of the map task.
> Please send me any ideas or suggestions.
>
> Thanks,
> Bharati
>
> Sent from my iPad
>
> Fortigate Filtered
>
>