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

amsal's gravatar image

amsal
1222
accept rate: 0%


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>
export CLASSPATH=$HADOOP_CLASSPATH

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.

link

answered 21 Feb '12, 20:26

ThanhMapR's gravatar image

ThanhMapR ♦♦
11
accept rate: 0%

edited 21 Feb '12, 20:31

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×85
×77

Asked: 20 Feb '12, 23:48

Seen: 1,533 times

Last updated: 21 Feb '12, 20:31

powered by OSQA