@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 InfoServer |
infoServer |
protected int |
listenPort |
private static org.slf4j.Logger |
LOG |
protected ThriftMetrics |
metrics |
protected JvmPauseMonitor |
pauseMonitor |
protected org.apache.thrift.TProcessor |
processor |
protected 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(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,
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() |
private String |
getSpengoPrincipal(org.apache.hadoop.conf.Configuration conf,
String host) |
private String |
getSpnegoKeytab(org.apache.hadoop.conf.Configuration conf) |
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() |
private static final org.slf4j.Logger LOG
protected org.apache.hadoop.conf.Configuration conf
protected 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 SaslUtil.QualityOfProtection qop
protected int listenPort
protected boolean securityEnabled
protected boolean doAsEnabled
protected JvmPauseMonitor pauseMonitor
protected volatile org.apache.thrift.server.TServer tserver
protected volatile org.eclipse.jetty.server.Server httpServer
public ThriftServer(org.apache.hadoop.conf.Configuration conf)
protected ThriftMetrics createThriftMetrics(org.apache.hadoop.conf.Configuration conf)
protected void setupParamters() throws IOException
IOException
private String getSpengoPrincipal(org.apache.hadoop.conf.Configuration conf, String host) throws IOException
IOException
private String getSpnegoKeytab(org.apache.hadoop.conf.Configuration conf)
protected void startInfoServer() throws IOException
IOException
protected void checkHttpSecurity(SaslUtil.QualityOfProtection qop, org.apache.hadoop.conf.Configuration conf)
protected HBaseServiceHandler createHandler(org.apache.hadoop.conf.Configuration conf, UserProvider userProvider) throws IOException
IOException
protected 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.ExitCodeException
protected org.apache.thrift.server.TServlet createTServlet(org.apache.thrift.protocol.TProtocolFactory protocolFactory)
protocolFactory
- protocolFactoryprotected void setupHTTPServer() throws IOException
IOException
- IOExceptionprotected void setupServer() throws Exception
Exception
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)
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
Exception
protected 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
UnknownHostException
public 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.ExitCodeException
protected void processOptions(String[] args) throws Exception
Exception
public 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.Tool
Exception
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.