Package org.apache.thrift.server

Examples of org.apache.thrift.server.TThreadPoolServer$Args


    TThreadPoolServer.Args args = new TThreadPoolServer.Args(
        serverTransport).processor(processor)
        .transportFactory(transportFactory)
        .protocolFactory(new TBinaryProtocol.Factory())
        .minWorkerThreads(minThreads).maxWorkerThreads(maxThreads);
    thriftServer = new TThreadPoolServer(args);
    LOGGER.info("Serving on " + address);
    thriftServer.serve();
  }
View Full Code Here


      }else{
        InetSocketAddress inetSocketAddress = new InetSocketAddress(serverHost, serverPort);
        serverTransport = new TServerSocket(inetSocketAddress);
      }
     
      server = new TThreadPoolServer(new TThreadPoolServer.Args(serverTransport).processor(appCatalogServerHandler));
            new Thread() {
        public void run() {
          server.serve();
          setStatus(ServerStatus.STOPPED);
          logger.info("Airavata Workflow Server Stopped.");
View Full Code Here

        serverTransport = new TServerSocket(inetSocketAddress);
      }
     
            TThreadPoolServer.Args options = new TThreadPoolServer.Args(serverTransport);
            options.minWorkerThreads = Integer.parseInt(ServerSettings.getSetting(Constants.API_SERVER_MIN_THREADS, "50"));
      server = new TThreadPoolServer(options.processor(airavataAPIServer));
            new Thread() {
        public void run() {
          server.serve();
          RegistryInitUtil.stopDerbyInServerMode();
          setStatus(ServerStatus.STOPPED);
View Full Code Here

     
            //server = new TSimpleServer(
              //      new TServer.Args(serverTransport).processor(orchestratorServerHandlerProcessor));
            TThreadPoolServer.Args options = new TThreadPoolServer.Args(serverTransport);
            options.minWorkerThreads = Integer.parseInt(ServerSettings.getSetting(Constants.ORCHESTRATOT_SERVER_MIN_THREADS, "30"));
            server = new TThreadPoolServer(options.processor(orchestratorServerHandlerProcessor));

            new Thread() {
        public void run() {
          server.serve();
          setStatus(ServerStatus.STOPPED);
View Full Code Here

            InetSocketAddress inetSocketAddress = new InetSocketAddress(serverHost, serverPort);

      TServerTransport serverTransport = new TServerSocket(inetSocketAddress);

            server = new TThreadPoolServer(new TThreadPoolServer.Args(serverTransport).processor(gfacServerHandlerProcessor));

            new Thread() {
        public void run() {
          server.serve();
          setStatus(IServer.ServerStatus.STOPPED);
View Full Code Here

          .transportFactory(transFactory)
          .protocolFactory(new TBinaryProtocol.Factory())
          .minWorkerThreads(minWorkerThreads)
          .maxWorkerThreads(maxWorkerThreads);

      TServer tServer = new TThreadPoolServer(args);
      HMSHandler.LOG.info("Started the new metaserver on port [" + port
          + "]...");
      HMSHandler.LOG.info("Options.minWorkerThreads = "
          + minWorkerThreads);
      HMSHandler.LOG.info("Options.maxWorkerThreads = "
          + maxWorkerThreads);
      HMSHandler.LOG.info("TCP keepalive = " + tcpKeepAlive);
      tServer.serve();
    } catch (Throwable x) {
      x.printStackTrace();
      HMSHandler.LOG.error(StringUtils.stringifyException(x));
      throw x;
    }
View Full Code Here

    ThriftTest.Processor<ThriftTest.Iface> processor = new ThriftTest.Processor<ThriftTest.Iface>(handler);
   
    TThreadPoolServer.Args args = new TThreadPoolServer.Args(serverTransport);
    args.stopTimeoutVal = 10;
    args.stopTimeoutUnit = TimeUnit.MILLISECONDS;
    final TServer server = new TThreadPoolServer(args.processor(processor));
    Thread thread = new Thread() {
      public void run() {
        server.serve();
      }
    };
    thread.start();
    while (!server.isServing()) {
      UtilWaitThread.sleep(10);
    }
   
    TTransport transport = new TSocket("localhost", port);
    transport.open();
    TProtocol protocol = new TBinaryProtocol(transport);
    ThriftTest.Client client = new ThriftTest.Client(protocol);
    assertTrue(client.success());
    assertFalse(client.fails());
    try {
      client.throwsError();
      fail("no exception thrown");
    } catch (ThriftSecurityException ex) {
      // expected
    }
    server.stop();
    thread.join();
  }
View Full Code Here

        }

        // ThreadPool Server
        TThreadPoolServer.Options options = new TThreadPoolServer.Options();
        options.minWorkerThreads = 64;
        serverEngine = new TThreadPoolServer(new TProcessorFactory(processor),
                                             tServerSocket,
                                             inTransportFactory,
                                             outTransportFactory,
                                             tProtocolFactory,
                                             tProtocolFactory,
View Full Code Here

    log.info("starting HBase ThreadPool Thrift server on " + inetSocketAddress.toString());
    TThreadPoolServer.Args serverArgs = new TThreadPoolServer.Args(serverTransport);
    serverArgs.processor(processor);
    serverArgs.transportFactory(transportFactory);
    serverArgs.protocolFactory(protocolFactory);
    return new TThreadPoolServer(serverArgs);
  }
View Full Code Here

    TThreadPoolServer.Args options = new TThreadPoolServer.Args(transport);
    options.protocolFactory(ThriftUtil.protocolFactory());
    options.transportFactory(ThriftUtil.transportFactory());
    processor = new TServerUtils.TimedProcessor(processor, serverName, threadName);
    options.processorFactory(new ClientInfoProcessorFactory(processor));
    return new ServerPort(new TThreadPoolServer(options), port);
  }
View Full Code Here

TOP

Related Classes of org.apache.thrift.server.TThreadPoolServer$Args

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.