@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); }
public ThriftServer(Map storm_conf, TProcessor processor, int port) { try { _storm_conf = storm_conf; _processor = processor; _port = port; // retrieve authentication configuration _login_conf = AuthUtils.GetConfiguration(_storm_conf); } catch (Exception x) { LOG.error(x.getMessage(), x); } }
/** * 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); }
TUGIWrapProcessor(TProcessor wrapped) { this.wrapped = wrapped; }
SimpleWrapProcessor(TProcessor wrapped) { this.wrapped = wrapped; }
/** * 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;