"Thrift is a software framework for scalable cross-language services development. It combines a software stack with a code generation engine to build services that work efficiently and seamlessly between C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, Smalltalk, and OCaml."
Important note: This Thrift interface is deprecated and scheduled for removal in HBase 0.22.
A new version that matches the client API that was introduced in HBase 0.21 can be found
in the contrib
directory.
The {@link org.apache.hadoop.hbase.thrift.generated.Hbase.Iface HBase API} is defined in the file Hbase.thrift (Click the former to see the thrift generated documentation of thrift interface). A server-side implementation of the API is in {@link org.apache.hadoop.hbase.thrift.ThriftServer}. The generated interfaces, types, and RPC utility files reside in the {@link org.apache.hadoop.hbase.thrift.generated} package.
To start ThriftServer, use:
./bin/hbase-daemon.sh start thrift
To stop, use:
./bin/hbase-daemon.sh stop thriftThese are the command line arguments the Thrift server understands in addition to
start
and stop
:
-b, --bind
0.0.0.0
]-p, --port
9090
]-f, --framed
-c, --compact
-h, --help
-threadpool
-hsha
-nonblocking
bind
option only works with the default ThreadPoolServer.
This will be fixed in the next Thrift version. See HBASE-2155
for more details on this issue.
HBase currently uses version 0.2.0 of Apache Thrift.
The files were generated by running the commands:
thrift -strict --gen java:hashcode Hbase.thrift mv gen-java/org/apache/hadoop/hbase/thrift/generated . rm -rf gen-java
The 'thrift' binary is the Thrift compiler, and it is distributed as a part
of the Thrift package. Additionally, specific language runtime libraries are a
part of the Thrift package. A version of the Java runtime is checked into SVN
under the hbase/lib
directory.