Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hadoop >> mail # user >> How to write the contents from mapper into file


Copy link to this message
-
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*
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB