I am learning the HBase. I know how to write a Java program using Hadoop MapReduce and write the output into HDFS; but now I want to write the same output into HBase, instead of HDFS. It should have some similar code like I did before in HDFS thing:
context.write(key,value);
Could anyone show me an example to achieve this?
Instead of using the FileOutputFormat when setting up your job, you should be able to use the TableOutputFormat.
http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.html
You will still have to modify your Reducer a little.
A quote from the page above:
Here's one way to do this:
You can read here about Table Mapper