Examples of TServerSocket


Examples of org.apache.thrift.transport.TServerSocket

        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);
            break; // On successful bind, abort the loop.
          } catch (TTransportException tte) {
            // Couldn't create a socket on this port. Try the next port.
            consolePort++;
            triesRemaining--;
View Full Code Here

Examples of org.apache.thrift.transport.TServerSocket

    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.TServerSocket

   
    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.TServerSocket

      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) {
         saslServer = bridge.createServer(
View Full Code Here

Examples of org.apache.thrift.transport.TServerSocket

        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.TServerSocket

            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.TServerSocket

  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.TServerSocket

  public void testThrift() throws Exception {
    TestReceiver tracer = new TestReceiver();
    Tracer.getInstance().addReceiver(tracer);
   
    ServerSocket socket = new ServerSocket(0);
    TServerSocket transport = new TServerSocket(socket);
    transport.listen();
    TThreadPoolServer.Args args = new TThreadPoolServer.Args(transport);
    args.processor(new TestService.Processor(TraceWrap.service(new Service())));
    final TServer tserver = new TThreadPoolServer(args);
    Thread t = new Thread() {
      public void run() {
View Full Code Here

Examples of org.apache.thrift.transport.TServerSocket

    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.TServerSocket

        CassandraServer peerStorageServer = new CassandraServer();
        peerStorageServer.start();
        Cassandra.Processor processor = new Cassandra.Processor(peerStorageServer);

        // Transport
        TServerSocket tServerSocket = new TServerSocket(new InetSocketAddress(listenAddr, listenPort));
       
        if (logger.isDebugEnabled())
            logger.debug(String.format("Binding thrift service to %s:%s", listenAddr, listenPort));

        // Protocol factory
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.