Skip to content
This repository has been archived by the owner on Jan 22, 2019. It is now read-only.

bmuller/hbaserb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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}"
}

About

HBase Thrift interface for Ruby

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages