Skip to content

eyberg/hrb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

What is this?
---------------
This is the latest (as of this writing) ruby thrift
client to hbase 0.2x.

I packaged this up cause it's a pain in the ass scping
all this crap over a couple different machines.

There are two DIFFERENT packages in here:

HRB:
  this is the native thrift bindings to access hbase

HRB-NG:
  this is the same thing but with a set of patches
that allow you to issue scans with start/stop rows

-------------------------------
    INSTALLING
-------------------------------

HBASE:
----------
git clone http://git.apache.org/hbase.git/
exportexport JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.14/jre/
cd hbase; ant

THRIFT:
----------
ensure you have all the required libraries
for this:

sudo apt-get install autoconf libtool libboost-dev
  g++ sun-java6-jdk ant flex bison pkg-config libevent-dev ruby-dev zlib1g-dev

NOTE:
  if you are using the latest jaunty jackalope on ubuntu
make a symlink like so: (looks like ubuntu is seperating our packages
once again)
  sudo ln -s /usr/include/boost/ /usr/local/include/boost-1_34_1

wget -O thrift.tgz "http://gitweb.thrift-rpc.org/?p=thrift.git;a=snapshot;h=HEAD;sf=tgz"
tar -xzf thrift.tgz
cd thrift; ./bootstrap.sh; ./configure; make; sudo make install

gem install mongrel echoe --no-ri --no-rdoc
cd ~/thrift/lib/rb
rake gem
sudo gem install pkg/thrift-0.1.0.gem --no-ri --no-rdoc

HRB:
-----------
gem build hrb.gemspec
sudo gem install hrb --no-ri --no-rdoc

HRB-NG:
-----------
gem build hrb-ng.gemspec
sudo gem install hrb-ng --no-ri --no-rdoc

-------------------------------
    RUNNING
-------------------------------
require 'rubygems'
require 'hrb-ng'

transport = Thrift::BufferedTransport.new(Thrift::Socket.new('127.0.0.1', 9090))
protocol = Thrift::BinaryProtocol.new(transport)
HBASE = Apache::Hadoop::Hbase::Client.new(protocol)
transport.open()

scanner = HBASE.scannerOpenWithStopStartTs("mytable", "myrow.0", "myrow.1",
["mycol:"], 1249677001723, 1249677009731)

-------------------------------
    RE-GENERATING HRB from a newer release
-------------------------------
mkdir ~/hrb
thrift --gen rb -o ~/hrb /opt/hbase2/srv/java/org/apache/hadoop/hbase/thrift/Hbase.thrift

About

hbase 0.2x ruby thrift client

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages