hi.. i want to access hbase table from hadoop mapreduce....i m using windowsXP and cygwin i m using hadoop-0.20.2 and hbase-0.92.0 hadoop cluster is working fine....i am able to run mapreduce wordcount successfully on 3 pc's hbase is also working .....i can cerate table from shell
i have tried many examples but they are not working....when i try to compile it using javac Example.java
it gives error..... org.apache.hadoop.hbase.client does not exist org.apache.hadoop.hbase does not exist org.apache.hadoop.hbase.io does not exist
please can anyone help me in this...... -plz give me some example code to access hbase from hadoop map reduce -also guide me how should i compile and execute it
asked 20 Feb '12, 23:48
The org.apache.hadoop.hbase.client and org.apache.hadoop.hbase.io packages are contained in the hbase-<version>.jar; you must include this jar in your CLASSPATH when you build/compile your mapreduce program.
If you have installed the MapR HBase package, as documented here http://www.mapr.com/doc/display/MapR/HBase , then your CLASSPATH should include /opt/mapr/hbase/hbase-<version>/hbase-<version>.jar. Recommend that you just set the following:
export HADOOP_CLASSPATH=`/opt/mapr/hbase/hbase-<version>/bin/hbase classpath`:<path to your custom map reduce classes>
since you will need the HADOOP_CLASSPATH anyway to run the hadoop client to run your mapreduce job.
As for example code, this article http://sujee.net/tech/articles/hadoop/hbase-map-reduce-freq-counter/ contains an excellent explanation along with source code that shows you how to access HBase tables from your mapreduce program.