Search in sources :

Example 1 with TThreadPoolServer

use of org.apache.thrift7.server.TThreadPoolServer in project storm by nathanmarz.

the class SaslTransportPlugin method getServer.

public TServer getServer(int port, TProcessor processor) throws IOException, TTransportException {
    TTransportFactory serverTransportFactory = getServerTransportFactory();
    //define THsHaServer args 
    //original: THsHaServer + TNonblockingServerSocket
    //option: TThreadPoolServer + TServerSocket
    TServerSocket serverTransport = new TServerSocket(port);
    TThreadPoolServer.Args server_args = new TThreadPoolServer.Args(serverTransport).processor(new TUGIWrapProcessor(processor)).minWorkerThreads(64).maxWorkerThreads(64).protocolFactory(new TBinaryProtocol.Factory());
    if (serverTransportFactory != null)
        server_args.transportFactory(serverTransportFactory);
    //construct THsHaServer
    return new TThreadPoolServer(server_args);
}
Also used : TServerSocket(org.apache.thrift7.transport.TServerSocket) TBinaryProtocol(org.apache.thrift7.protocol.TBinaryProtocol) TTransportFactory(org.apache.thrift7.transport.TTransportFactory) TThreadPoolServer(org.apache.thrift7.server.TThreadPoolServer)

Aggregations

TBinaryProtocol (org.apache.thrift7.protocol.TBinaryProtocol)1 TThreadPoolServer (org.apache.thrift7.server.TThreadPoolServer)1 TServerSocket (org.apache.thrift7.transport.TServerSocket)1 TTransportFactory (org.apache.thrift7.transport.TTransportFactory)1