Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
MapReduce, mail # user - Re: How to write the contents from mapper into file


+
Sahil Agarwal 2013-11-13, 17:50
Copy link to this message
-
Re: How to write the contents from mapper into file
unmesha sreeveni 2013-11-15, 09:32
[solved] It is due to permission issue.
On Wed, Nov 13, 2013 at 11:27 PM, Rahul Bhattacharjee <
[EMAIL PROTECTED]> 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 <[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.
>>
>>
>
--
*Thanks & Regards*

Unmesha Sreeveni U.B

*Junior Developer*