This is a common C++ client that accesses HBase cluster through HBase ThriftServer. It based on HBase thrift, but not the new thrift interface in HBase 0.94+ version.
- Download, decompress and install thrift-0.8.0.
wget https://dist.apache.org/repos/dist/release/thrift/0.8.0/thrift-0.8.0.tar.gz tar zxvf thrift-0.8.0.tar.gz sudo yum install automake libtool flex bison pkgconfig gcc-c++ boost-devel libevent-devel zlib-devel python-devel ruby-devel cd thrift-0.8.0 ./configure make sudo make install
- Download and decompress hbase-0.92.1 or previous versions.
wget http://www.fayea.com/apache-mirror/hbase/hbase-0.92.1/hbase-0.92.1.tar.gz tar zxvf hbase-0.92.1.tar.gz
- Run Thrift to generate the cpp module HBase:
thrift --gen cpp [hbase-root]/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift
- Make the project to generate binary program:
make demo make test
- Execute the binary program:
./demo [host] [port] ./testput [host] [port] [key_len] [val_len] [list_num] ./testget [host] [port] [key_len] [val_len] [list_num] [block_cache_flag]
- Yuan Panfeng (@ypf412)