-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
80 lines (62 loc) · 2.12 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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