Package org.apache.thrift.server

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


      // Simple Server
      //serverEngine = new TSimpleServer(new Args(tServerSocket).processor(testProcessor));

      // ThreadPool Server
      serverEngine = new TThreadPoolServer(new TThreadPoolServer.Args(tServerSocket).processor(testProcessor).protocolFactory(tProtocolFactory));

      // Run it
      System.out.println("Starting the server on port " + port + "...");
      serverEngine.serve();
View Full Code Here


                    }

                }
                Class processor = Class.forName(parent.split("\\$")[0] + "$Processor");
                servers.add(
                        new TThreadPoolServer(
                                new TThreadPoolServer
                                        .Args(

                                        new TServerSocket(
                                                Integer.parseInt(entry.getValue().get(".port"))
View Full Code Here

    TThreadPoolServer.Args sargs = new TThreadPoolServer.Args(serverTransport).processorFactory(hfactory).
        transportFactory(new TTransportFactory()).
        protocolFactory(new TBinaryProtocol.Factory()).
        minWorkerThreads(minThreads).
        maxWorkerThreads(maxThreads);
    server = new TThreadPoolServer(sargs);

    //  Hive 0.7.x (unfortunately it doesn't support passing a configuration object to it)
    //
    //    ThriftHiveProcessorFactory hfactory = new ThriftHiveProcessorFactory(null);
    //    TThreadPoolServer.Options options = new TThreadPoolServer.Options();
View Full Code Here

      TServerSocket socket = new TServerSocket(port);
      Classifier.Processor processor = new Classifier.Processor(
          modelHandler);

      TProtocolFactory protocol = new TBinaryProtocol.Factory(true, true);
      server = new TThreadPoolServer(
          new TThreadPoolServer.Args(socket).processor(processor));

      log.warn("Starting server on port {}", port);
      server.serve();
    } finally {
View Full Code Here

        TProtocolFactory tProtocolFactory = new TBinaryProtocol.Factory();

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

                protocolFactory(new TBinaryProtocol.Factory());           
        if (serverTransportFactory != null)
            server_args.transportFactory(serverTransportFactory);

        //construct THsHaServer
        return new TThreadPoolServer(server_args);
    }
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

    try {
      InetSocketAddress bindAddr = new InetSocketAddress(host, port);
      serverTransport = new TServerSocket(bindAddr);
      ThriftFlumeEventServer.Processor processor =
          new ThriftFlumeEventServer.Processor(new ThriftFlumeEventServerImpl());
      server = new TThreadPoolServer(new TThreadPoolServer.
          Args(serverTransport).processor(processor));
    } catch (TTransportException e) {
      e.printStackTrace();
      return;
    }
View Full Code Here

      }

      TThreadPoolServer.Options options = new TThreadPoolServer.Options();
      options.minWorkerThreads = minWorkerThreads;
      options.maxWorkerThreads = maxWorkerThreads;
      TServer tServer = new TThreadPoolServer(processor, serverTransport,
          transFactory, transFactory,
          new TBinaryProtocol.Factory(), new TBinaryProtocol.Factory(), options);
      HMSHandler.LOG.info("Started the new metaserver on port [" + port
          + "]...");
      HMSHandler.LOG.info("Options.minWorkerThreads = "
          + options.minWorkerThreads);
      HMSHandler.LOG.info("Options.maxWorkerThreads = "
          + options.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

        port = Integer.parseInt(args[0]);
      }
      TServerTransport serverTransport = new TServerSocket(port);
      ThriftHiveProcessorFactory hfactory = new ThriftHiveProcessorFactory(null);
      TThreadPoolServer.Options options = new TThreadPoolServer.Options();
      TServer server = new TThreadPoolServer(hfactory, serverTransport,
          new TTransportFactory(), new TTransportFactory(),
          new TBinaryProtocol.Factory(), new TBinaryProtocol.Factory(), options);
      HiveServerHandler.LOG.info("Starting hive server on port " + port);
      server.serve();
    } catch (Exception x) {
      x.printStackTrace();
    }
  }
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.