Return-Path: Delivered-To: apmail-hadoop-core-user-archive@www.apache.org Received: (qmail 29987 invoked from network); 3 Nov 2008 20:37:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Nov 2008 20:37:48 -0000 Received: (qmail 48278 invoked by uid 500); 3 Nov 2008 20:37:49 -0000 Delivered-To: apmail-hadoop-core-user-archive@hadoop.apache.org Received: (qmail 48233 invoked by uid 500); 3 Nov 2008 20:37:49 -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 48222 invoked by uid 99); 3 Nov 2008 20:37:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 12:37:49 -0800 X-ASF-Spam-Status: No, hits=3.2 required=10.0 tests=HTML_MESSAGE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [72.14.204.238] (HELO qb-out-0506.google.com) (72.14.204.238) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 20:36:34 +0000 Received: by qb-out-0506.google.com with SMTP id f30so1106589qba.35 for ; Mon, 03 Nov 2008 12:37:01 -0800 (PST) Received: by 10.103.243.9 with SMTP id v9mr269040mur.44.1225744620743; Mon, 03 Nov 2008 12:37:00 -0800 (PST) Received: by 10.103.165.15 with HTTP; Mon, 3 Nov 2008 12:37:00 -0800 (PST) Message-ID: Date: Mon, 3 Nov 2008 14:37:00 -0600 From: "Aaron Kimball" To: core-user@hadoop.apache.org Subject: Re: Passing Constants from One Job to the Next In-Reply-To: <74f4d40b0810301502u5de4f271h18a443ff25e7cdde@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_62871_14766544.1225744620740" References: <62DC94C5-38EE-4A32-A198-FF74B73FCB58@yahoo-inc.com> <74f4d40b0810301502u5de4f271h18a443ff25e7cdde@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_62871_14766544.1225744620740 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline The Mapper and Reducer interfaces both provide a method 'void configure(JobConf conf) throws IOException'; if you extend MapReduceBase, this will provide a dummy implementation of configure(). You can add your own implementation; it will be called before the first call to map() or reduce(). You can read your initialization data at this time. - Aaron On Thu, Oct 30, 2008 at 4:02 PM, Erik Holstad wrote: > Hi! > Is there a way of using the value read in the configure() in the Map or > Reduce phase? > > Erik > > On Thu, Oct 23, 2008 at 2:40 AM, Aaron Kimball wrote: > > > See Configuration.setInt() in the API. (JobConf inherits from > > Configuration). You can read it back in the configure() method of your > > mappers/reducers > > - Aaron > > > > On Wed, Oct 22, 2008 at 3:03 PM, Yih Sun Khoo wrote: > > > > > Are you saying that I can pass, say, a single integer constant with > > either > > > of these three: JobConf? A HDFS file? DistributedCache? > > > Or are you asking if I can pass given the context of: JobConf? A HDFS > > file? > > > DistributedCache? > > > I'm thinking of how to pass a single int so from one Jobconf to the > next > > > > > > On Wed, Oct 22, 2008 at 2:57 PM, Arun C Murthy > > wrote: > > > > > > > > > > > On Oct 22, 2008, at 2:52 PM, Yih Sun Khoo wrote: > > > > > > > > I like to hear some good ways of passing constants from one job to > the > > > >> next. > > > >> > > > > > > > > Unless I'm missing something: JobConf? A HDFS file? DistributedCache? > > > > > > > > Arun > > > > > > > > > > > > > > > >> These are some ways that I can think of: > > > >> 1) The obvious solution is to carry the constant as part of your > > value > > > >> from > > > >> one job to the next, but that would mean every value would hold that > > > >> constant > > > >> 2) Use the reporter as a hack so that you can set the status > message > > > and > > > >> then get the status message back when u need the constant > > > >> > > > >> Any other ideas? (Also please do not include code) > > > >> > > > > > > > > > > > > > > ------=_Part_62871_14766544.1225744620740--