Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Small and handy Ruby driver for HBase
branch: master
Failed to load latest commit information.
lib 8386063: Add :to_hash method for hbase-driver
.gitignore 5993703: creating .gitignore
Rakefile 8386063: Add :to_hash method for hbase-driver 5993703: updating readme

Ruby driver for HBase

Small and handy Ruby driver for HBase (via Stargate RESTfull interface).


Warning: HBase and Stargate should be installed and running.

require 'hbase'

hbase ='http://localhost:8080')

# creating table
hbase.create 'users'

# listing all tables
p hbase.all.collect{|t|} # => ['users']

# create record
users.update 'john', 'attr:email' => ''

# get record
john = users['john']
p john['attr:email'] # => ""    

# update record
users.update 'john', 'attr:email' => ""
p john['attr:email'] # => ""

# deleting record
users.delete 'john'    

# scanning
users.update 'john', 'attr:email' => ''
users.update 'mario', 'attr:email' => ''
users.update 'stanley', 'attr:email' => ''

list = users.scan :start => 'john', :batch => 5, :columns => ['attr:']
p list.collect{|user| user['attr:email']} # => ['', '', '']


$ gem install ruby-driver

For installation of HBase and Stargate please see HBase docs (google it).

Warning: currently HBase distributed with RESTful interface called 'rest' and it's deprecated and broken. And because it looks very similar to Stargate it's easy to mix it up. So, be aware, you need to install and use the Stargate, not default and broken HBase REST client.


Something went wrong with that request. Please try again.