Examples of TServerTransport


Examples of org.apache.thrift.transport.TServerTransport

        // Start our own server hosting the ClientConsole service, so
        // the server can send us back results.
        ClientConsoleImpl consoleImpl = new ClientConsoleImpl();
        consolePort = mConf.getInt(ClientConsoleImpl.CONSOLE_SERVER_PORT_KEY,
            ClientConsoleImpl.DEFAULT_CONSOLE_SERVER_PORT);
        TServerTransport consoleTransport = null;
        int triesRemaining = MAX_PORTS_TO_TRY;
        while (triesRemaining > 0) {
          LOG.debug("Trying to start ClientConsole service on port " + consolePort);
          try {
            consoleTransport = new TServerSocket(consolePort);
View Full Code Here

Examples of org.apache.thrift.transport.TServerTransport

    Runtime.getRuntime().addShutdownHook(new ShutdownLogger());

    RemoteServerImpl remoteImpl = new RemoteServerImpl(mConf);

    int port = mConf.getInt(THRIFT_SERVER_PORT_KEY, DEFAULT_THRIFT_SERVER_PORT);
    TServerTransport transport = new TServerSocket(port);
    TTransportFactory transportFactory = new TFramedTransport.Factory();
    TProtocolFactory protocolFactory = new TBinaryProtocol.Factory();
    TProcessor processor = new RemoteServer.Processor(remoteImpl);

    TServer server = new TThreadPoolServer(processor, transport, transportFactory,
View Full Code Here

Examples of org.apache.thrift.transport.TServerTransport

   
    int port = conf.getPort(Property.TRACE_PORT);
    final ServerSocket sock = ServerSocketChannel.open().socket();
    sock.setReuseAddress(true);
    sock.bind(new InetSocketAddress(port));
    final TServerTransport transport = new TServerSocket(sock);
    TThreadPoolServer.Args options = new TThreadPoolServer.Args(transport);
    options.processor(new SpanReceiver.Processor(new Receiver()));
    server = new TThreadPoolServer(options);
    final InetSocketAddress address = new InetSocketAddress(Accumulo.getLocalAddress(args), sock.getLocalPort());
    registerInZooKeeper(AddressUtil.toString(address));
View Full Code Here

Examples of org.apache.thrift.transport.TServerTransport

      int minWorkerThreads = conf.getIntVar(HiveConf.ConfVars.METASTORESERVERMINTHREADS);
      int maxWorkerThreads = conf.getIntVar(HiveConf.ConfVars.METASTORESERVERMAXTHREADS);
      boolean tcpKeepAlive = conf.getBoolVar(HiveConf.ConfVars.METASTORE_TCP_KEEP_ALIVE);
      useSasl = conf.getBoolVar(HiveConf.ConfVars.METASTORE_USE_THRIFT_SASL);

      TServerTransport serverTransport = tcpKeepAlive ?
          new TServerSocketKeepAlive(port) : new TServerSocket(port);

      TProcessor processor = new ThriftHiveMetastore.Processor(handler);
      TTransportFactory transFactory;
      if (useSasl) {
View Full Code Here

Examples of org.apache.thrift.transport.TServerTransport

        port = Integer.parseInt(args[0]);
      }
      if (args.length >= 2) {
        minWorkerThreads = Integer.parseInt(args[1]);
      }
      TServerTransport serverTransport = new TServerSocket(port);
      ThriftHiveProcessorFactory hfactory = new ThriftHiveProcessorFactory(null);
      TThreadPoolServer.Options options = new TThreadPoolServer.Options();
      options.minWorkerThreads = minWorkerThreads;
      TServer server = new TThreadPoolServer(hfactory, serverTransport,
          new TTransportFactory(), new TTransportFactory(),
View Full Code Here

Examples of org.apache.thrift.transport.TServerTransport

            Long.MAX_VALUE, TimeUnit.SECONDS, callQueue, tfb.build());
  }

  private static TServer getTThreadPoolServer(TProtocolFactory protocolFactory, THBaseService.Processor processor,
      TTransportFactory transportFactory, InetSocketAddress inetSocketAddress) throws TTransportException {
    TServerTransport serverTransport = new TServerSocket(inetSocketAddress);
    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);
View Full Code Here

Examples of org.apache.thrift.transport.TServerTransport

  public static void main(String [] args) {
    try {
      CalculatorHandler handler = new CalculatorHandler();
      Calculator.Processor processor = new Calculator.Processor(handler);
      TServerTransport serverTransport = new TServerSocket(9090);
      TServer server = new TSimpleServer(processor, serverTransport);

      // Use this for a multithreaded server
      // server = new TThreadPoolServer(processor, serverTransport);
View Full Code Here

Examples of org.apache.thrift.transport.TServerTransport

    log.info("Preparing to start echo service.");

    final ContainerOfEnumsTestService.Processor<EchoServiceDefinition> processor =
        new ContainerOfEnumsTestService.Processor<EchoServiceDefinition>(
            new EchoServiceDefinition(protocol));
    final TServerTransport transport = new TServerSocket(port);

    final Args serviceArguments = new Args(transport);
    serviceArguments.processor(processor);
    serviceArguments.protocolFactory(Enum.valueOf(Protocol.class, protocol).getFactory());
View Full Code Here

Examples of org.apache.thrift.transport.TServerTransport

    Log LOG = LogFactory.getLog("ThriftServer");
    LOG.info("starting HBase Thrift server on port " +
      Integer.toString(port));
    HBaseHandler handler = new HBaseHandler();
    Hbase.Processor processor = new Hbase.Processor(handler);
    TServerTransport serverTransport = new TServerSocket(port);
    TProtocolFactory protFactory = new TBinaryProtocol.Factory(true, true);
    TServer server = new TThreadPoolServer(processor, serverTransport,
      protFactory);
    server.serve();
  }
View Full Code Here

Examples of org.apache.thrift.transport.TServerTransport

   
    int port = conf.getPort(Property.TRACE_PORT);
    final ServerSocket sock = ServerSocketChannel.open().socket();
    sock.setReuseAddress(true);
    sock.bind(new InetSocketAddress(port));
    final TServerTransport transport = new TServerSocket(sock);
    TThreadPoolServer.Args options = new TThreadPoolServer.Args(transport);
    options.processor(new Processor<Iface>(new Receiver()));
    server = new TThreadPoolServer(options);
    final InetSocketAddress address = new InetSocketAddress(hostname, sock.getLocalPort());
    registerInZooKeeper(AddressUtil.toString(address));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.