Package org.apache.hadoop.hbase.thrift2

package org.apache.hadoop.hbase.thrift2
Provides an HBase Thrift service. This package contains a Thrift interface definition file for an HBase RPC service and a Java server implementation. There are currently 2 thrift server implementations in HBase, the packages:
  • org.apache.hadoop.hbase.thrift: This may one day be marked as depreceated.
  • org.apache.hadoop.hbase.thrift2: i.e. this package. This is intended to closely match to the HTable interface and to one day supercede the older thrift (the old thrift mimics an API HBase no longer has).

What is Thrift?

"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, JavaScript, Node.js, Smalltalk, and OCaml. Originally developed at Facebook, Thrift was open sourced in April 2007 and entered the Apache Incubator in May, 2008". From


The HBase API is defined in the file hbase.thrift. A server-side implementation of the API is in org.apache.hadoop.hbase.thrift2.ThriftHBaseServiceHandler with the server boiler plate in org.apache.hadoop.hbase.thrift2.ThriftServer. The generated interfaces, types, and RPC utility files are checked into SVN under the org.apache.hadoop.hbase.thrift2.generated directory.

To stop, use:

  ./bin/ stop thrift2
These are the command line arguments the Thrift server understands in addition to start and stop:
-b, --bind
Address to bind the Thrift server to. Not supported by the Nonblocking and HsHa server [default:]
-p, --port
Port to bind to [default: 9090]
-f, --framed
Use framed transport (implied when using one of the non-blocking servers)
-c, --compact
Use the compact protocol [default: binary protocol]
-h, --help
Displays usage information for the Thrift server
Use the TThreadPoolServer. This is the default.
Use the THsHaServer. This implies the framed transport.
Use the TNonblockingServer. This implies the framed transport.


HBase currently uses version 0.9.0 of Apache Thrift.

The files were generated by running the commands under the hbase checkout dir:

  mvn compile -Pcompile-thrift

The 'thrift' binary is the Thrift compiler, and it is distributed separately from HBase in a Thrift release. Additionally, specific language runtime libraries are a part of a Thrift release. A version of the Java runtime is included in HBase via maven.