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 <[email protected]>wrote: > I’m not sure if it’s best way, but if all you’re looking for is the > contents produced from the mapper, you could have a reducer function that > just returns the data from the mapper unmodified. > > -Sahil > > From: unmesha sreeveni <[email protected]> > Reply-To: "[email protected]" <[email protected]> > Date: Tuesday, November 12, 2013 at 9:51 PM > To: User Hadoop <[email protected]> > 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<Object, Text, Text, MatrixWritable > { > public void map(Object key, Text value, Context context) > throws IOException, InterruptedException { > Configuration conf = new Configuration(); > FileSystem fs = FileSystem.get(conf); > > Path inputfile = new Path("in/map"); > BufferedWriter getdatabuffer = new BufferedWriter(new > OutputStreamWriter(fs.create(inputfile))); > if(value.toString()!= 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 person or > entity to which it is addressed, and may contain material confidential to > Xoom Corporation, and/or its subsidiary, buyindiaonline.com Inc. Any review, > retransmission, dissemination or other use of, or taking of any action 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. > >
