Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

HBase Thrift interface for Ruby

branch: master
README.rdoc

hbaserb – HBase Thrift interface for Ruby

A Ruby thrift lib for interfacing with Hadoop's HBase 0.92.0

To install:

gem install hbaserb

Basic Usage

require 'rubygems'
require 'hbaserb'

client = HBaseRb::Client.new 'localhost'

# create table with two column families
table = client.create_table "test_table", "colfamone", "colfamtwo"

# insert some data
table.mutate_row 'myrow', {'colfamone:myvalue' => 'awesome value'}

# delete some data
table.mutate_row 'myrow', {'colfamone:myvalue' => nil}

# get it
puts t.get('myrow', 'colfamone:myvalue').first.value

# get timestamp
puts t.get('myrow', 'colfamone:myvalue').first.timestamp

# convert binary value to 64 bit integer
t.atomic_increment('myrow', 'colfamtwo:counter')
puts t.get('myrow', 'colfamtwo:counter').first.to_i64

# make a scanner
s = t.create_scanner('my-start-row', 'my-end-row', 'colfamnone') { |row|
  puts "Columns: #{row.columns.keys}"
}
Something went wrong with that request. Please try again.