Return-Path: Delivered-To: apmail-hadoop-core-user-archive@www.apache.org Received: (qmail 74687 invoked from network); 18 Jun 2009 14:41:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Jun 2009 14:41:08 -0000 Received: (qmail 66483 invoked by uid 500); 18 Jun 2009 14:41:17 -0000 Delivered-To: apmail-hadoop-core-user-archive@hadoop.apache.org Received: (qmail 66412 invoked by uid 500); 18 Jun 2009 14:41:16 -0000 Mailing-List: contact core-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-user@hadoop.apache.org Delivered-To: mailing list core-user@hadoop.apache.org Received: (qmail 66402 invoked by uid 99); 18 Jun 2009 14:41:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jun 2009 14:41:16 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mdesnoyer@gmail.com designates 209.85.132.242 as permitted sender) Received: from [209.85.132.242] (HELO an-out-0708.google.com) (209.85.132.242) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jun 2009 14:41:05 +0000 Received: by an-out-0708.google.com with SMTP id c2so545723anc.29 for ; Thu, 18 Jun 2009 07:40:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=zIBmqIWmD2SZ7ow+lN71nO1KJK1O2L6NrXxt5ah7k3g=; b=NgG/o/IcREEhH/oEhHqwmMREYnxQDBaCMYoKMnBiojcTIjwlGBvEoFG1IfEYzp9a+o gTfZHjWjxzRofkV2nQiz1WSPxawiQIrbMK1WkN04qXZv/dxeDghfnVpuYDa+ETOQcvgE KAJKgiyB4tn2BQ/iJn6iw+WMZbBUcP7Eq6JXc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=qHk5X7mRxDoKOCxvqZpB+Lve4OJIUTp4QTiSLS7krtyTzfCB1NtRfTiBC5o1PW6K6q 4hlRpL/wNkho+FCqF+ZVkETk/zMQwzBgpRRME1BAXKBS18ydhxWHMkEAzKQZdjQGLwu/ os8VRCIk9/qgcaFNlh9Dmi1Xiba3KILuslAbM= MIME-Version: 1.0 Received: by 10.100.172.16 with SMTP id u16mr2137638ane.85.1245335625172; Thu, 18 Jun 2009 07:33:45 -0700 (PDT) In-Reply-To: References: <5aae27ff0906180718k4565ca3cvcde60c0d461bc46f@mail.gmail.com> From: Mark Desnoyer Date: Thu, 18 Jun 2009 10:33:25 -0400 Message-ID: Subject: Re: Getting Task ID inside a Mapper To: core-user@hadoop.apache.org Content-Type: multipart/alternative; boundary=0016368e1c09908bfc046ca04be2 X-Virus-Checked: Checked by ClamAV on apache.org --0016368e1c09908bfc046ca04be2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Thanks! I'll try that. -Mark On Thu, Jun 18, 2009 at 10:27 AM, Jingkei Ly wrote: > I think you can use job.getInt("mapred.task.partition",-1) to get the > mapper ID, which should be the same for the mapper across task reruns. > > -----Original Message----- > From: Piotr Praczyk [mailto:piotr.praczyk@gmail.com] > Sent: 18 June 2009 15:19 > To: core-user@hadoop.apache.org > Subject: Re: Getting Task ID inside a Mapper > > Hi > Why don't you provide a seed of random generator generated outside the > task > ? Then when the task fails, you can provide the same value stored > somewhere > outside. > You could use the task configuration to do so. > > I don't know anything about obtaining the task ID from within. > > > regards > Piotr > > 2009/6/18 Mark Desnoyer > > > Hi, > > > > I was wondering if it's possible to get a hold of the task id inside a > > mapper? I cant' seem to find a way by trolling through the API > reference. > > I'm trying to implement a Map Reduce version of Latent Dirichlet > Allocation > > and I need to be able to initialize a random number generator in a > task > > specific way so that if the task fails and is rerun elsewhere, the > results > > are the same. Thanks in advance. > > > > Cheers, > > Mark Desnoyer > > > > > > This message should be regarded as confidential. If you have received this > email in error please notify the sender and destroy it immediately. > Statements of intent shall only become binding when confirmed in hard copy > by an authorised signatory. The contents of this email may relate to > dealings with other companies within the Detica Group plc group of > companies. > > Detica Limited is registered in England under No: 1337451. > > Registered offices: Surrey Research Park, Guildford, Surrey, GU2 7YP, > England. > > > --0016368e1c09908bfc046ca04be2--