Return-Path: Delivered-To: apmail-hadoop-common-user-archive@www.apache.org Received: (qmail 58161 invoked from network); 8 Jul 2009 13:39:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Jul 2009 13:39:59 -0000 Received: (qmail 8308 invoked by uid 500); 8 Jul 2009 13:40:06 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 8236 invoked by uid 500); 8 Jul 2009 13:40:06 -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 8226 invoked by uid 99); 8 Jul 2009 13:40:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jul 2009 13:40:06 +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 dongogo@gmail.com designates 209.85.222.196 as permitted sender) Received: from [209.85.222.196] (HELO mail-pz0-f196.google.com) (209.85.222.196) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jul 2009 13:39:58 +0000 Received: by pzk34 with SMTP id 34so4714473pzk.5 for ; Wed, 08 Jul 2009 06:39:38 -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 :date:message-id:subject:from:to:content-type; bh=X4zalnq2vSORMQeplzl/8eCs+n1WG88mTIEZ7dfUHvw=; b=FGuldgbz7sXO6khrgUdRgq4W5rKpGKs7xfF2ZepbAmYNikp1ryoNbfowGP4ingY5vC lC9AdUKuthR6CqFqSGuVJ3hAKe5LM0BObT4rRbw6HFpJCpBbudnSOnrtoJc/+uKtY6D4 Sd657zc6dzZTogO8m4MEokMVi7JRkHVPx7/Kw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=U1t7Tq+TM39vQlD0E8tx3oqGEV9PIsRwDbtj7yhGzqj7YxD7xFPjtoA/FtvWKH/JaS m+425LqNrDwNeMRzI7LBxozerLqzDgK/KpbdL/k22qOLkFMT6QT+KTodQzLO9LSfP0Ee aSzN/YL7avbUqa1NmnHOsBAAqLn5ZQtpa8Ez0= MIME-Version: 1.0 Received: by 10.114.157.1 with SMTP id f1mr11383217wae.43.1247060378480; Wed, 08 Jul 2009 06:39:38 -0700 (PDT) In-Reply-To: <4af5cd780907080423t4dbfbe1ch7db41fedbc38d551@mail.gmail.com> References: <98c73dc40907080228g33af0c88u246d49c0c02ceed7@mail.gmail.com> <4af5cd780907080423t4dbfbe1ch7db41fedbc38d551@mail.gmail.com> Date: Wed, 8 Jul 2009 21:39:38 +0800 Message-ID: <98c73dc40907080639u7503e0acu8e37c5398ff583f0@mail.gmail.com> Subject: Re: Can mapper use MultipleOutputs ?? From: Johnson Chen To: common-user@hadoop.apache.org Content-Type: multipart/alternative; boundary=001636456fd6df7bea046e31dedf X-Virus-Checked: Checked by ClamAV on apache.org --001636456fd6df7bea046e31dedf Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Solved! Thank you! 2009/7/8 Stuart White > Are you calling mos.close() in your Mapper's close() method? For example: > > public static class Map extends MapReduceBase implements Mapper { > > (... all the stuff you already have ...) > > @Override > public void close() throws IOException { > mos.close(); > } > } > > > > On Wed, Jul 8, 2009 at 4:28 AM, Johnson Chen wrote: > > > Hi , > > I want to output data from each Mapper , so I write the following code. > > > > public static class Map extends MapReduceBase implements Mapper { > > private MultipleOutputs mos ; > > > > public void configure(JobConf job) { > > mos = new MultipleOutputs(job); > > } > > > > mos.getCollector("hashtable", reporter).collect( new Text( > > output_data ) , new Text("")); > > ... > > } > > > > I got hashtable-m-00000 ~ hahashtable-m-00009 files. > > > > But when I looked into these files , they were all empty . > > > > However , when I put MultipleOutputs in Reducer , it works! > > > > > > Why ? Can Mapper use MultipleOutputs ? > > > > > > > > > > -- > > Best wishes, > > Johnson Chen > > > -- Best wishes, Johnson Chen --001636456fd6df7bea046e31dedf--