@Override 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); }
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); }
/** * We will let Thrift to apply default transport factory */ @Override public TServer getServer(int port, TProcessor processor) throws IOException, TTransportException { TNonblockingServerSocket serverTransport = new TNonblockingServerSocket( port); THsHaServer.Args server_args = new THsHaServer.Args(serverTransport) .processor(new SimpleWrapProcessor(processor)) .workerThreads(64) .protocolFactory(new TBinaryProtocol.Factory()); // construct THsHaServer return new THsHaServer(server_args); }
/** * We will let Thrift to apply default transport factory */ public TServer getServer(int port, TProcessor processor) throws IOException, TTransportException { TNonblockingServerSocket serverTransport = new TNonblockingServerSocket(port); THsHaServer.Args server_args = new THsHaServer.Args(serverTransport). processor(new SimpleWrapProcessor(processor)). workerThreads(64). protocolFactory(new TBinaryProtocol.Factory()); //construct THsHaServer return new THsHaServer(server_args); }
/** * We will let Thrift to apply default transport factory */ public TServer getServer(int port, TProcessor processor) throws IOException, TTransportException { TNonblockingServerSocket serverTransport = new TNonblockingServerSocket( port); THsHaServer.Args server_args = new THsHaServer.Args(serverTransport) .processor(new SimpleWrapProcessor(processor)) .workerThreads(64) .protocolFactory(new TBinaryProtocol.Factory()); // construct THsHaServer return new THsHaServer(server_args); }
/** * Create a server associated with a given port and service handler * * @param port * listening port * @param processor * service handler * @return server to be binded */ public TServer getServer(int port, TProcessor processor) throws IOException, TTransportException;
/** * Create a server associated with a given port and service handler * @param port listening port * @param processor service handler * @return server to be binded */ public TServer getServer(int port, TProcessor processor) throws IOException, TTransportException;