Return-Path: X-Original-To: apmail-hadoop-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 43CB910FE5 for ; Fri, 15 Nov 2013 09:35:39 +0000 (UTC) Received: (qmail 88654 invoked by uid 500); 15 Nov 2013 09:32:47 -0000 Delivered-To: apmail-hadoop-user-archive@hadoop.apache.org Received: (qmail 88511 invoked by uid 500); 15 Nov 2013 09:32:45 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 88484 invoked by uid 99); 15 Nov 2013 09:32:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Nov 2013 09:32:43 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of unmeshabiju@gmail.com designates 209.85.212.49 as permitted sender) Received: from [209.85.212.49] (HELO mail-vb0-f49.google.com) (209.85.212.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Nov 2013 09:32:39 +0000 Received: by mail-vb0-f49.google.com with SMTP id o19so2534589vbm.8 for ; Fri, 15 Nov 2013 01:32:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=tTIfv9lLglxLEOZiMbNZPTS6WcBheS1WMYWaJ1jm0s4=; b=iwrBlddgqSuo7JCWtHbQhXHD51l4EQkAcT6M6s9kWBZ7F/c1aoUjucw8F/gKrGGguw TRddrnMwcqdHChG9efyWX0MngYReUTsSZ+4xeDsH0fyhmoLPnklbpLmNs5BDbgU/h0ck l1lGMZewn3YD0YBXEickLlmDsQ7GN1K3RzXQUjdvCD8y9sYzl0FLTzgM6wpPu1Q4liVo vvcWGRc5i3mOaNIjqHP9wPfX0HcNg0KIMBes/Aou7sFujrQw/4RxfXlIPFS/u59X0JLL 9v1gC7omAc29ZZkGeeJCgvKTAdgnGxPcVh3niBrHXa6K5xBRzjQhgoYodrw0beYE2TsD n5lg== MIME-Version: 1.0 X-Received: by 10.58.118.84 with SMTP id kk20mr773064veb.26.1384507939086; Fri, 15 Nov 2013 01:32:19 -0800 (PST) Received: by 10.59.8.2 with HTTP; Fri, 15 Nov 2013 01:32:19 -0800 (PST) In-Reply-To: References: Date: Fri, 15 Nov 2013 15:02:19 +0530 Message-ID: Subject: Re: How to write the contents from mapper into file From: unmesha sreeveni To: User Hadoop Content-Type: multipart/alternative; boundary=089e0122a086e5e95c04eb33df05 X-Virus-Checked: Checked by ClamAV on apache.org --089e0122a086e5e95c04eb33df05 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable [solved] It is due to permission issue. On Wed, Nov 13, 2013 at 11:27 PM, Rahul Bhattacharjee < rahul.rec.dgp@gmail.com> wrote: > If you have a map only job , then the output of the mappers would be > written by hadoop itself. > > thanks, > Rahul > > > On Wed, Nov 13, 2013 at 9:50 AM, Sahil Agarwal wr= ote: > >> I=92m not sure if it=92s best way, but if all you=92re looking for is = the >> contents produced from the mapper, you could have a reducer function tha= t >> just returns the data from the mapper unmodified. >> >> -Sahil >> >> From: unmesha sreeveni >> Reply-To: "user@hadoop.apache.org" >> Date: Tuesday, November 12, 2013 at 9:51 PM >> To: User Hadoop >> Subject: How to write the contents from mapper into file >> >> How to write the contents of mapper into file. Is this fine. >> >> If my inputfile is splited whether my blw code works? >> >> In reducer i am combining this data. >> >> >> public class MyMapper extends >> Mapper { >> public void map(Object key, Text value, Context context) >> throws IOException, InterruptedException { >> Configuration conf =3D new Configuration(); >> FileSystem fs =3D FileSystem.get(conf); >> >> Path inputfile =3D new Path("in/map"); >> BufferedWriter getdatabuffer =3D new BufferedWriter(new >> OutputStreamWriter(fs.create(inputfile))); >> if(value.toString()!=3D null){ >> getdatabuffer.write(value.toString()); >> } >> getdatabuffer.close(); >> >> -- >> *Thanks & Regards* >> >> Unmesha Sreeveni U.B >> >> *Junior Developer * >> >> >> ---------------------------------------------------------------------= ------------ >> The information transmitted in this email is intended only for the perso= n or entity to which it is addressed, and may contain material confidential= to Xoom Corporation, and/or its subsidiary, buyindiaonline.com Inc. Any r= eview, retransmission, dissemination or other use of, or taking of any acti= on in reliance upon, this information by persons or entities other than the= intended recipient(s) is prohibited. If you received this email in error= , please contact the sender and delete the material from your files. >> >> > --=20 *Thanks & Regards* Unmesha Sreeveni U.B *Junior Developer* --089e0122a086e5e95c04eb33df05 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable
[solved] It is due to permission issue.


On Wed, Nov 13, 2013 at= 11:27 PM, Rahul Bhattacharjee <rahul.rec.dgp@gmail.com> wrote:
If you have a map only job , then the= output of the mappers would be written by hadoop itself.

thanks,
Rahul


On Wed, Nov = 13, 2013 at 9:50 AM, Sahil Agarwal <sahil.agarwal@xoom.com> wrote:
I=92m not sure if it=92s best way, but if all you=92re looking for is = the contents produced from the mapper, you could have a reducer function th= at just returns the data from the mapper unmodified.

-Sahil

From: unmesha sreeveni <unmeshabiju@gmail.com>
Reply-To: "
user@hadoop.apache.org" &= lt;user@hadoop.= apache.org>
Date: Tuesday, November 12, 2013 at= 9:51 PM
To: User Hadoop <user@hadoop.apache.org>=
Subject: How to write the contents = from mapper into file

How t= o write the contents of mapper into file. Is this fine.

If my= inputfile is splited whether my blw code works?

In re= ducer i am combining this data.


public class MyM= apper extends
Mapper<Object, Text, Text, MatrixWritable &g= t; {
public void map(= Object key, Text value, Context context)
throws IOException, InterruptedException {
=A0Configuration conf =3D new Configuration();<= /font>
=A0 FileSystem f= s =3D FileSystem.get(conf);
=A0 =A0
=A0 Path inputfi= le =3D new Path("in/map");
=A0 BufferedWrit= er getdatabuffer =3D new BufferedWriter(new OutputStreamWriter(fs.create(in= putfile)));
=A0=A0if(value.t= oString()!=3D null){
=A0 =A0 =A0getdatabuffer.write(value.toString());
=A0 =A0 }
=A0 =A0 getdatabuffer.close();

--
Thanks & Regards

Unmesha Sreeveni U.B
Junior Developer


----------------------------------------------------------------------=
-----------
The information transmitted in this email is intended only for the person o=
r entity to which it is addressed, and may contain material confidential to=
 Xoom Corporation, and/or its subsidiary, buyindiaonline.com Inc.  Any review, retransmiss=
ion, dissemination or other use of, or taking of any action in reliance upo=
n, this information by persons or entities other than the intended recipien=
t(s) is prohibited.   If you received this email in error, please contact t=
he sender and delete the material from your files.




--
=
Thanks & Regards

Unmesha Sreeveni U.B
Junior Developer

--089e0122a086e5e95c04eb33df05--