Return-Path: X-Original-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6A06CF20A for ; Thu, 25 Apr 2013 17:09:24 +0000 (UTC) Received: (qmail 91954 invoked by uid 500); 25 Apr 2013 17:09:19 -0000 Delivered-To: apmail-hadoop-mapreduce-user-archive@hadoop.apache.org Received: (qmail 91841 invoked by uid 500); 25 Apr 2013 17:09:19 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 91834 invoked by uid 99); 25 Apr 2013 17:09:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Apr 2013 17:09:19 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,MIME_HTML_MOSTLY,RCVD_IN_DNSWL_NONE X-Spam-Check-By: apache.org Received-SPF: error (nike.apache.org: local policy) Received: from [209.85.192.169] (HELO mail-pd0-f169.google.com) (209.85.192.169) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Apr 2013 17:09:13 +0000 Received: by mail-pd0-f169.google.com with SMTP id 10so1946943pdc.28 for ; Thu, 25 Apr 2013 10:08:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:subject:references:from:content-type:x-mailer :in-reply-to:message-id:date:to:mime-version:x-gm-message-state; bh=Qxupnv8MtYwmquzx0JxgUwzJXBadnzzUHbrU4elmOD4=; b=Ef7LhtVh6v5BeMKcix3auipx9KmpnVbwoarn1klbpRq00oK9Tj0nHqriR+Algf8DN9 egPR/xIiVx9sFcq9TrvrALa4tQ4Eat4IiuLa9zRAwXwtoiNQQRH/leOgNhWnZdeXp8sE CIuJeIR/8rJEL9xwrIWEx62VlsiNT+W1h2sdg2PSKp4W+kZBbqh9u5ezFjjkIGnxlnX4 uwaIhIkRKtB+bzPE3Ro3BGTeZUixQOfkaaE9NN1091vev4V0sEjqd7x+vmLdvls0djqS YlVAZ28Z0eklZwCqMXOI+uSodaqNwUsgNmXmYjZzG6JXwJig/QS3ygNpfom9ctSbZeYG TaxQ== X-Received: by 10.66.119.5 with SMTP id kq5mr29923008pab.193.1366909711985; Thu, 25 Apr 2013 10:08:31 -0700 (PDT) Received: from [192.168.1.131] (173-8-138-90-SFBA.hfc.comcastbusiness.net. [173.8.138.90]) by mx.google.com with ESMTPSA id yp2sm8935934pab.10.2013.04.25.10.08.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Apr 2013 10:08:31 -0700 (PDT) Subject: Re: TaskID References: From: Bharati Content-Type: multipart/mixed; boundary="----=neXtPaRt_1366909711" X-Mailer: iPhone Mail (10B146) In-Reply-To: Message-Id: <5863B400-B28A-4FE9-A82B-A6AF82D63AF6@mparallelo.com> Date: Thu, 25 Apr 2013 10:08:30 -0700 To: "user@hadoop.apache.org" Mime-Version: 1.0 (1.0) X-Gm-Message-State: ALoCoQlMm+XlAiO76yd3R7MJMaerueRcm+1HOgfy4XjaXBcs3rvYYbkQ+GaBXHtgo+hYRLJ239B6 X-Virus-Checked: Checked by ClamAV on apache.org ------=neXtPaRt_1366909711 Content-Type: multipart/alternative; boundary=Apple-Mail-16C22E5D-58AE-482C-BA24-2F2A96F9AE26 Content-Transfer-Encoding: 7bit --Apple-Mail-16C22E5D-58AE-482C-BA24-2F2A96F9AE26 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Thanks, I will try it and let you know if I run into problems.=20 Sent from my iPhone On Apr 25, 2013, at 9:20 AM, Chris Nauroth wrote:= > Hi Bharati, >=20 > Your mapper class implementation methods have access to a MapContext: >=20 > http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/MapC= ontext.html >=20 > This is a subclass of TaskAttemptContext: >=20 > http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/Task= AttemptContext.html >=20 > You can use the TaskAttemptContext to call getTaskAttemptId and retrieve a= TaskAttemptID object: >=20 > http://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/Task= AttemptID.html >=20 > A task attempt ID consists of the task ID + an attempt number. Note that t= ask ID alone is not guaranteed to be unique across execution of the whole jo= b. Due to speculative execution or transient task failures, multiple attemp= ts of the same task can run, and they'll all have the same task ID. The tas= k ID + attempt number is guaranteed to be unique within the job. >=20 > BTW, it's pretty much the same process for a reducer too, except you're wo= rking with a ReduceContext instead of a MapContext. >=20 > Hope this helps, > --Chris >=20 >=20 >=20 >=20 >=20 >=20 >=20 > On Thu, Apr 25, 2013 at 8:45 AM, Bharati wr= ote: >> Hi Folks, >>=20 >> I need to find the task ID of the map task. >> Please send me any ideas or suggestions. >>=20 >> Thanks, >> Bharati >>=20 >> Sent from my iPad >>=20 >> Fortigate Filtered >=20 --Apple-Mail-16C22E5D-58AE-482C-BA24-2F2A96F9AE26 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
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 <cnauroth@hortonworks.com> wrote:

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,
--Chris







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


--Apple-Mail-16C22E5D-58AE-482C-BA24-2F2A96F9AE26-- ------=neXtPaRt_1366909711 Content-Type: text/plain; Fortigate Filtered ------=neXtPaRt_1366909711--