Return-Path: Delivered-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Received: (qmail 59674 invoked from network); 12 Aug 2010 02:24:17 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Aug 2010 02:24:17 -0000 Received: (qmail 46355 invoked by uid 500); 12 Aug 2010 02:24:16 -0000 Delivered-To: apmail-hadoop-mapreduce-user-archive@hadoop.apache.org Received: (qmail 46092 invoked by uid 500); 12 Aug 2010 02:24:16 -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 46084 invoked by uid 99); 12 Aug 2010 02:24:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Aug 2010 02:24:15 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.97.132.74] (HELO homiemail-a37.g.dreamhost.com) (208.97.132.74) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Aug 2010 02:24:09 +0000 Received: from homiemail-a37.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a37.g.dreamhost.com (Postfix) with ESMTP id BD19D1D006B for ; Wed, 11 Aug 2010 19:23:48 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=darose.net; h=message-id:date :from:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; q=dns; s=darose.net; b= kVbH5MJ/ZsbTDd7PL3a+id+J/V7q/RcuUiyUhOBqYVg7892I45BiRAFRjxUwUPnf icZHhOPny5x32S3sRC2uMZnEWQxJ2PorLdFribZ+T4RfpIykgcsdySkVUYfV9oRm cUlCMHE5shTEHalUItDJDD6kQiDCr1vq13+fQEP3E/A= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=darose.net; h=message-id :date:from:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; s=darose.net; bh=w7ofzX MpM/qVorqPiOo9SgiIka0=; b=jeEzOFPeIDVMXcuvMV6KU2tJjiqGlKOgqCKUkv QMT0zHXnsYBrp2MH3qQdyUOqdiYeAH4Y+4/CD8PXBqOVEWpdnnkGutQgWAYY1E7S dy29mrqCEK+N17+DlBqAL4U9d2nTSLd2gtkiT5WY0vH1Zv1Him9fimdzS9ZkEihc gnWI4= Received: from darsys12 (cpe-66-108-142-190.nyc.res.rr.com [66.108.142.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: darose@darose.net) by homiemail-a37.g.dreamhost.com (Postfix) with ESMTPSA id 9B9311D0065 for ; Wed, 11 Aug 2010 19:23:48 -0700 (PDT) Received: from [10.1.0.2] by darsys12 with esmtp (Exim 4.72) (envelope-from ) id 1OjNSN-0006sx-7O for mapreduce-user@hadoop.apache.org; Wed, 11 Aug 2010 22:23:47 -0400 Message-ID: <4C635B40.5040003@darose.net> Date: Wed, 11 Aug 2010 22:24:00 -0400 From: David Rosenstrauch User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100806 Lanikai/3.1.2 MIME-Version: 1.0 To: mapreduce-user@hadoop.apache.org Subject: Re: mrunit question References: <4C61B57D.6010509@darose.net> <4C61BC9C.1080301@darose.net> <4C620EA3.5030303@darose.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 08/11/2010 08:14 PM, Aaron Kimball wrote: > David, > > Since you are directly instantiating the Mapper and Reducer (not using > ReflectionUtils), you are free to call setConf() yourself before you run the > test. Sort of. What would wind up happening is that setConf would get called twice: once by the mrunit framework with the empty config (for which I'd need to add special coding in to my reducer object to make it ignore it) and then a second time when I explicitly call it myself in my JUnit test. It's not really ideal for me to have to add special code into my reducer to avoid this issue. > If you're using the new API, there already is setConfiguration() and > withConfiguration(), which will set the Configuration being passed into > Context sent to your Mapper/Reducer's run() method. > See https://issues.apache.org/jira/browse/mapreduce-1569 where this was > introduced. > > > - Aaron Yes, just looked at that, and it looks like it exactly solves this issue. Unfortunately, though, it says that fix is effective in v0.21. As we're running the stable CDH version (CDH2, which uses Hadoop v0.20) I can't take advantage of that fix yet. Going to wind up forgoing unit tests on this M/R code for right now I think. Thanks, DR