Return-Path: Delivered-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Received: (qmail 36622 invoked from network); 4 Dec 2010 02:00:45 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 4 Dec 2010 02:00:45 -0000 Received: (qmail 21794 invoked by uid 500); 4 Dec 2010 02:00:44 -0000 Delivered-To: apmail-hadoop-mapreduce-user-archive@hadoop.apache.org Received: (qmail 21724 invoked by uid 500); 4 Dec 2010 02:00:44 -0000 Mailing-List: contact mapreduce-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mapreduce-user@hadoop.apache.org Delivered-To: mailing list mapreduce-user@hadoop.apache.org Received: (qmail 20963 invoked by uid 99); 4 Dec 2010 02:00:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Dec 2010 02:00:43 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of qwertymaniac@gmail.com designates 209.85.161.48 as permitted sender) Received: from [209.85.161.48] (HELO mail-fx0-f48.google.com) (209.85.161.48) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Dec 2010 02:00:38 +0000 Received: by fxm2 with SMTP id 2so8485684fxm.35 for ; Fri, 03 Dec 2010 18:00:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=PMHT1iZmsMVX44eJ+Qp/RIruW20apl+RFZZhw0PAlh4=; b=LGT0hp41ItsJU62yfLqg0mGGc2EYqhSa6GarjHdzS/5P7ymExZw+171qTArRZ1yvW0 LV0kcfO1Yr7UX9vGITiPTAFNzxgjGHO3e10OcK1UoL4K0DuenNWtS2rprs4Z8E15L/PJ aoeUv8s92rbt9OF2MM2RK+AmQa4wJMZ8rdcjA= 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=FYZvv7k2yOZQfwUEMaYwZMP4yehh+harAtbNl+vyaVg/4JZlkx9Oi/UGBLqhTD6oDz BrSDb8W8UxUS5LKZDdrFeb8YNKZc2bXqNDdXEeZ4fa+G9VdXdtQk3ePL798M7jyf4ws9 3vJ/RqEPyOaivYk8xQUxsd+xTOAzjD20M7f7I= Received: by 10.223.102.135 with SMTP id g7mr825983fao.29.1291428017552; Fri, 03 Dec 2010 18:00:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.113.145 with HTTP; Fri, 3 Dec 2010 17:59:56 -0800 (PST) In-Reply-To: References: From: Harsh J Date: Sat, 4 Dec 2010 07:29:56 +0530 Message-ID: Subject: Re: Is it pissible get a number of mapper tasks? To: mapreduce-user@hadoop.apache.org Content-Type: text/plain; charset=ISO-8859-1 Hi, (Answers may be 0.20 specific) On Sat, Dec 4, 2010 at 6:41 AM, Jason wrote: > In my mapper code I need to know the total number of mappers which is the same as number of input splits. > (I need it for unique int Id generation) mapred.map.tasks is set for every job before launch and is the total number of maps that are going to run for a successful result. There are more identifiers, however: mapred.task.id is the task's id (contains various info, map/reduce). mapred.attempt.id is the task's _attempt_ id (basically task id, with attempt information, map/reduce). mapred.task.partition is the unique partition id per task (perhaps you can utilize this integer itself, applies to map/reduce) (Some of these vars have methods of setter/getter in JobConf itself) > > > Basically Im looking for an analog of context.getNumReduceTasks() but can't find it. > > > Thanks > > > >> > -- Harsh J www.harshj.com