HiveServer2 (HS2) is a service that enables clients to execute queries against Hive. HiveServer2 is success to HiveServer1 which has been deprecated. HS2 supports multi-client concurrency and authentication. It is designed to provide better support for open API clients like JDBC and ODBC.
HS2 is a single process running as a composite service, which includes the Thrift based service (TCP or HTTP) and a Jetty web server for web UI. You can specify the transport mode of the Thrift service through the hive config: "hive.server2.transport.mode".
Thrift is a RPC framework for building cross-platform services. Its stack consists of 4 layers: Server, Transport, Protocol and Processor. The usage of those layers from HS2 implementation is described as follows.
Server
HS2 uses TThreadPoolServer for TCP mode and Jetty server for HTTP transport and