@InterfaceAudience.LimitedPrivate(value="Tools")
public class ThriftServer
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.util.Tool
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.hadoop.conf.Configuration |
conf |
protected boolean |
doAsEnabled |
protected HBaseServiceHandler |
hbaseServiceHandler |
protected String |
host |
protected boolean |
httpEnabled |
protected org.eclipse.jetty.server.Server |
httpServer |
protected org.apache.hadoop.security.UserGroupInformation |
httpUGI |
protected org.apache.hadoop.hbase.http.InfoServer |
infoServer |
protected int |
listenPort |
protected ThriftMetrics |
metrics |
protected org.apache.hadoop.hbase.util.JvmPauseMonitor |
pauseMonitor |
protected org.apache.thrift.TProcessor |
processor |
protected org.apache.hadoop.hbase.security.SaslUtil.QualityOfProtection |
qop |
protected boolean |
securityEnabled |
protected org.apache.hadoop.security.UserGroupInformation |
serviceUGI |
protected org.apache.thrift.server.TServer |
tserver |
| Constructor and Description |
|---|
ThriftServer(org.apache.hadoop.conf.Configuration conf) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addOptions(org.apache.hbase.thirdparty.org.apache.commons.cli.Options options)
Add options to command lines
|
protected void |
checkHttpSecurity(org.apache.hadoop.hbase.security.SaslUtil.QualityOfProtection qop,
org.apache.hadoop.conf.Configuration conf) |
protected ExecutorService |
createExecutor(BlockingQueue<Runnable> callQueue,
int minWorkers,
int maxWorkers) |
protected HBaseServiceHandler |
createHandler(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.hbase.security.UserProvider userProvider) |
protected org.apache.thrift.TProcessor |
createProcessor() |
protected ThriftMetrics |
createThriftMetrics(org.apache.hadoop.conf.Configuration conf) |
protected org.apache.thrift.server.TServlet |
createTServlet(org.apache.thrift.protocol.TProtocolFactory protocolFactory)
Create a Servlet for the http server
|
protected InetAddress |
getBindAddress(org.apache.hadoop.conf.Configuration conf) |
org.eclipse.jetty.server.Server |
getHttpServer()
the Jetty server, not null means the HTTP server is started, for test only
|
protected org.apache.thrift.protocol.TProtocolFactory |
getProtocolFactory() |
protected org.apache.thrift.server.TServer |
getTHsHaServer(org.apache.thrift.transport.TNonblockingServerTransport serverTransport,
org.apache.thrift.protocol.TProtocolFactory protocolFactory,
org.apache.thrift.TProcessor processor,
org.apache.thrift.transport.TTransportFactory transportFactory,
InetSocketAddress inetSocketAddress) |
protected org.apache.thrift.server.TServer |
getTNonBlockingServer(org.apache.thrift.transport.TNonblockingServerTransport serverTransport,
org.apache.thrift.protocol.TProtocolFactory protocolFactory,
org.apache.thrift.TProcessor processor,
org.apache.thrift.transport.TTransportFactory transportFactory,
InetSocketAddress inetSocketAddress) |
org.apache.thrift.server.TServer |
getTserver()
the thrift server, not null means the server is started, for test only
|
protected org.apache.thrift.server.TServer |
getTThreadedSelectorServer(org.apache.thrift.transport.TNonblockingServerTransport serverTransport,
org.apache.thrift.protocol.TProtocolFactory protocolFactory,
org.apache.thrift.TProcessor processor,
org.apache.thrift.transport.TTransportFactory transportFactory,
InetSocketAddress inetSocketAddress) |
protected org.apache.thrift.server.TServer |
getTThreadPoolServer(org.apache.thrift.protocol.TProtocolFactory protocolFactory,
org.apache.thrift.TProcessor processor,
org.apache.thrift.transport.TTransportFactory transportFactory,
InetSocketAddress inetSocketAddress) |
static void |
main(String[] args) |
protected static void |
optionToConf(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd,
String option,
org.apache.hadoop.conf.Configuration conf,
String destConfKey) |
protected void |
parseCommandLine(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd,
org.apache.hbase.thirdparty.org.apache.commons.cli.Options options) |
protected void |
printUsageAndExit(org.apache.hbase.thirdparty.org.apache.commons.cli.Options options,
int exitCode) |
protected void |
processOptions(String[] args)
Parse the command line options to set parameters the conf.
|
static void |
registerFilters(org.apache.hadoop.conf.Configuration conf) |
int |
run()
Run without any command line arguments
|
int |
run(String[] strings) |
protected void |
setupHTTPServer()
Setup an HTTP Server using Jetty to serve calls from THttpClient
|
protected void |
setupParamters() |
protected void |
setupServer()
Setting up the thrift TServer
|
protected void |
startInfoServer() |
void |
stop() |
protected org.apache.hadoop.conf.Configuration conf
protected org.apache.hadoop.hbase.http.InfoServer infoServer
protected org.apache.thrift.TProcessor processor
protected ThriftMetrics metrics
protected HBaseServiceHandler hbaseServiceHandler
protected org.apache.hadoop.security.UserGroupInformation serviceUGI
protected org.apache.hadoop.security.UserGroupInformation httpUGI
protected boolean httpEnabled
protected org.apache.hadoop.hbase.security.SaslUtil.QualityOfProtection qop
protected String host
protected int listenPort
protected boolean securityEnabled
protected boolean doAsEnabled
protected org.apache.hadoop.hbase.util.JvmPauseMonitor pauseMonitor
protected volatile org.apache.thrift.server.TServer tserver
protected volatile org.eclipse.jetty.server.Server httpServer
protected ThriftMetrics createThriftMetrics(org.apache.hadoop.conf.Configuration conf)
protected void setupParamters()
throws IOException
IOExceptionprotected void startInfoServer()
throws IOException
IOExceptionprotected void checkHttpSecurity(org.apache.hadoop.hbase.security.SaslUtil.QualityOfProtection qop,
org.apache.hadoop.conf.Configuration conf)
protected HBaseServiceHandler createHandler(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.security.UserProvider userProvider) throws IOException
IOExceptionprotected org.apache.thrift.TProcessor createProcessor()
public org.apache.thrift.server.TServer getTserver()
public org.eclipse.jetty.server.Server getHttpServer()
protected void printUsageAndExit(org.apache.hbase.thirdparty.org.apache.commons.cli.Options options,
int exitCode)
throws org.apache.hadoop.util.Shell.ExitCodeException
org.apache.hadoop.util.Shell.ExitCodeExceptionprotected org.apache.thrift.server.TServlet createTServlet(org.apache.thrift.protocol.TProtocolFactory protocolFactory)
protocolFactory - protocolFactoryprotected void setupHTTPServer()
throws IOException
IOException - IOExceptionprotected void setupServer()
throws Exception
Exceptionprotected org.apache.thrift.server.TServer getTNonBlockingServer(org.apache.thrift.transport.TNonblockingServerTransport serverTransport,
org.apache.thrift.protocol.TProtocolFactory protocolFactory,
org.apache.thrift.TProcessor processor,
org.apache.thrift.transport.TTransportFactory transportFactory,
InetSocketAddress inetSocketAddress)
protected org.apache.thrift.server.TServer getTHsHaServer(org.apache.thrift.transport.TNonblockingServerTransport serverTransport,
org.apache.thrift.protocol.TProtocolFactory protocolFactory,
org.apache.thrift.TProcessor processor,
org.apache.thrift.transport.TTransportFactory transportFactory,
InetSocketAddress inetSocketAddress)
protected org.apache.thrift.server.TServer getTThreadedSelectorServer(org.apache.thrift.transport.TNonblockingServerTransport serverTransport,
org.apache.thrift.protocol.TProtocolFactory protocolFactory,
org.apache.thrift.TProcessor processor,
org.apache.thrift.transport.TTransportFactory transportFactory,
InetSocketAddress inetSocketAddress)
protected org.apache.thrift.server.TServer getTThreadPoolServer(org.apache.thrift.protocol.TProtocolFactory protocolFactory,
org.apache.thrift.TProcessor processor,
org.apache.thrift.transport.TTransportFactory transportFactory,
InetSocketAddress inetSocketAddress)
throws Exception
Exceptionprotected org.apache.thrift.protocol.TProtocolFactory getProtocolFactory()
protected ExecutorService createExecutor(BlockingQueue<Runnable> callQueue, int minWorkers, int maxWorkers)
protected InetAddress getBindAddress(org.apache.hadoop.conf.Configuration conf) throws UnknownHostException
UnknownHostExceptionpublic static void registerFilters(org.apache.hadoop.conf.Configuration conf)
protected void addOptions(org.apache.hbase.thirdparty.org.apache.commons.cli.Options options)
options - optionsprotected void parseCommandLine(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd,
org.apache.hbase.thirdparty.org.apache.commons.cli.Options options)
throws org.apache.hadoop.util.Shell.ExitCodeException
org.apache.hadoop.util.Shell.ExitCodeExceptionprotected void processOptions(String[] args) throws Exception
Exceptionpublic void stop()
protected static void optionToConf(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd,
String option,
org.apache.hadoop.conf.Configuration conf,
String destConfKey)
public int run()
throws Exception
Exception - exceptionpublic int run(String[] strings) throws Exception
run in interface org.apache.hadoop.util.ToolExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.