hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Nauroth <cnaur...@hortonworks.com>
Subject Re: TaskID
Date Thu, 25 Apr 2013 16:20:53 GMT
Hi Bharati,

Your mapper class implementation methods have access to a MapContext:


This is a subclass of TaskAttemptContext:


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


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,

On Thu, Apr 25, 2013 at 8:45 AM, Bharati <bharati.adkar@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

View raw message