TServerTransport serverTransport = tcpKeepAlive ?
new TServerSocketKeepAlive(port) : new TServerSocket(port);
TProcessor processor;
TTransportFactory transFactory;
if (useSasl) {
saslServer = bridge.createServer(
conf.getVar(HiveConf.ConfVars.METASTORE_KERBEROS_KEYTAB_FILE),
conf.getVar(HiveConf.ConfVars.METASTORE_KERBEROS_PRINCIPAL));
// start delegation token manager
saslServer.startDelegationTokenSecretManager(conf);
transFactory = saslServer.createTransportFactory();
processor = saslServer.wrapProcessor(new ThriftHiveMetastore.Processor(
new HMSHandler("new db based metaserver", conf)));
} else {
processor = new ThriftHiveMetastore.Processor(
new HMSHandler("new db based metaserver", conf));
transFactory = new TTransportFactory();
}
TThreadPoolServer.Args args = new TThreadPoolServer.Args(serverTransport)
.processor(processor)
.transportFactory(transFactory)