Return-Path: Delivered-To: apmail-hadoop-common-user-archive@www.apache.org Received: (qmail 87386 invoked from network); 5 Jan 2010 12:11:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Jan 2010 12:11:21 -0000 Received: (qmail 48123 invoked by uid 500); 5 Jan 2010 12:11:18 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 48037 invoked by uid 500); 5 Jan 2010 12:11:18 -0000 Mailing-List: contact common-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-user@hadoop.apache.org Delivered-To: mailing list common-user@hadoop.apache.org Received: (qmail 48027 invoked by uid 99); 5 Jan 2010 12:11:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jan 2010 12:11:18 +0000 X-ASF-Spam-Status: No, hits=4.2 required=10.0 tests=HTML_MESSAGE,NO_RDNS_DOTCOM_HELO,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [216.145.54.173] (HELO mrout3.yahoo.com) (216.145.54.173) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jan 2010 12:11:08 +0000 Received: from EGL-EX07CAS02.ds.corp.yahoo.com (egl-ex07cas02.eglbp.corp.yahoo.com [203.83.248.209]) by mrout3.yahoo.com (8.13.6/8.13.6/y.out) with ESMTP id o05C9DmB041555 for ; Tue, 5 Jan 2010 04:09:14 -0800 (PST) DomainKey-Signature: a=rsa-sha1; s=serpent; d=yahoo-inc.com; c=nofws; q=dns; h=received:from:to:date:subject:thread-topic:thread-index: message-id:in-reply-to:accept-language:content-language: x-ms-has-attach:x-ms-tnef-correlator:acceptlanguage:content-type:mime-version; b=lc2eRioADltoyRdhpRAKRC1TFkgMG97YmCujh8Ghxj7KmoKh9R1HwWxRIfnszBK5 Received: from EGL-EX07VS01.ds.corp.yahoo.com ([203.83.248.205]) by EGL-EX07CAS02.ds.corp.yahoo.com ([203.83.248.216]) with mapi; Tue, 5 Jan 2010 17:39:13 +0530 From: Amogh Vasekar To: "common-user@hadoop.apache.org" Date: Tue, 5 Jan 2010 17:39:10 +0530 Subject: Re: Configuration.set/Configuration.get now working Thread-Topic: Configuration.set/Configuration.get now working Thread-Index: AcqM3MFJVmubY4+JSJqizVZV8Gq96wBIyHXw Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_C76929BE59CFamoghyahooinccom_" MIME-Version: 1.0 --_000_C76929BE59CFamoghyahooinccom_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, 1. map.input.file in new API is contentious. It doesn't seem to be seralize= d in .20 ( https://issues.apache.org/jira/browse/HADOOP-5973 ) . As of now = you can use ((FileSplit)context.getInputSplit).getPath() , there was a post= on this sometime back. 2. for your own variables in conf, please ensure you set them first and the= n provide to job. For eg this works for me : Configuration conf =3D new Configuration(); conf.set("myprop","i_set_this"); conf.set("mapred.job.queue.name","queue"); Job myjob =3D new Job(conf); And then in setup System.out.println("property is " + context.getConfiguration().get("myprop"= ,"failed")); Hope this helps Amogh On 1/4/10 6:52 AM, "Farhan Husain" wrote: Hello all, I am still stuck with the following problem. Can anyone please help me? Thanks, Farhan On Wed, Dec 30, 2009 at 11:21 AM, Farhan Husain wrote: > Hello, > > I am using hadoop-0.20.1. I need to know the input file name in my map > processes and pass an integer and a string to my reduce processes. I used > the following method calls for that: > > config.set("tag1", "string_value"); > config.setInt("tag2", int_value); > > In setup method of mapper: > String filename =3D > context.getConfiguration().get("map.input.file") // returns nu= ll > > In setup method of reducer: > String val =3D > context.getConfiguration().get("tag1"); // > returns null > int n =3D context.getConfiguration().getInt("tag2", > def_val); // returns def_val > > Can anyone please tell me what may be wrong with this code or anything > related to it? > > Thanks, > Farhan > --_000_C76929BE59CFamoghyahooinccom_--