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 Plain View
MapReduce >> mail # user >> Writing multiple tables from reducer


Copy link to this message
-
Writing multiple tables from reducer
Hi,
  I am new to hbase and am trying to achieve the following.

I am reading data from hdfs in mapper and parsing it..

So, in reducer I want my output to write to hbase instead of hdfs
But here is the thing.

public static class MyTableReducer extends TableReducer<Text, Text,
ImmutableBytesWritable>  {

 public void reduce(Text key, Iterable<Text> values, Context context)
throws IOException, InterruptedException {
int type = getType(values.toString());
if (type == 1) // put data to table 1
if (type==2) // put data to table 2
   }
}

How do I do this?
Thanks
+
Ravi Kiran 2013-08-28, 03:11
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