Examples of TTransportFactory


Examples of com.facebook.presto.hive.shaded.org.apache.thrift.transport.TTransportFactory

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

      TProcessor processor;
      TTransportFactory transFactory;
      if (useSasl) {
        // we are in secure mode.
        if (useFramedTransport) {
          throw new HiveMetaException("Framed transport is not supported with SASL enabled.");
        }
        saslServer = bridge.createServer(
            conf.getVar(HiveConf.ConfVars.METASTORE_KERBEROS_KEYTAB_FILE),
            conf.getVar(HiveConf.ConfVars.METASTORE_KERBEROS_PRINCIPAL));
        // start delegation token manager
        HMSHandler hmsHandler = new HMSHandler("new db based metaserver", conf);
        saslServer.startDelegationTokenSecretManager(conf, hmsHandler);
        transFactory = saslServer.createTransportFactory(
                MetaStoreUtils.getMetaStoreSaslProperties(conf));
        processor = saslServer.wrapProcessor(
          new ThriftHiveMetastore.Processor<HMSHandler>(hmsHandler));
        LOG.info("Starting DB backed MetaStore Server in Secure Mode");
      } else {
        // we are in unsecure mode.
        IHMSHandler handler = newHMSHandler("new db based metaserver", conf);

        if (conf.getBoolVar(ConfVars.METASTORE_EXECUTE_SET_UGI)) {
          transFactory = useFramedTransport ?
              new ChainedTTransportFactory(new TFramedTransport.Factory(),
                  new TUGIContainingTransport.Factory())
              : new TUGIContainingTransport.Factory();

          processor = new TUGIBasedProcessor<IHMSHandler>(handler);
          LOG.info("Starting DB backed MetaStore Server with SetUGI enabled");
        } else {
          transFactory = useFramedTransport ?
              new TFramedTransport.Factory() : new TTransportFactory();
          processor = new TSetIpAddressProcessor<IHMSHandler>(handler);
          LOG.info("Starting DB backed MetaStore Server");
        }
      }
View Full Code Here

Examples of com.facebook.thrift.transport.TTransportFactory

      FacebookService.Processor processor = new ThriftMetaStore.Processor(handler);

      TThreadPoolServer.Options options = new TThreadPoolServer.Options();
      options.minWorkerThreads = 100;
      TServer server = new TThreadPoolServer(processor, serverTransport,
               new TTransportFactory(), new TTransportFactory(),
               new TBinaryProtocol.Factory(), new TBinaryProtocol.Factory(), options);

      ThriftMetaStoreHandler.LOG.info("Starting the metaserver on port [" + port + "]...");

      server.serve();
View Full Code Here

Examples of com.facebook.thrift.transport.TTransportFactory

      TServerTransport serverTransport = new TServerSocket(port);
      Iface handler = new HiveServerHandler();
      FacebookService.Processor processor = new ThriftHive.Processor(handler);
      TThreadPoolServer.Options options = new TThreadPoolServer.Options();
      TServer server = new TThreadPoolServer(processor, serverTransport,
          new TTransportFactory(), new TTransportFactory(),
          new TBinaryProtocol.Factory(), new TBinaryProtocol.Factory(), options);
      server.serve();
      HiveServerHandler.LOG.info("Started the new hive server on port " + port);
    } catch (Exception x) {
      x.printStackTrace();
View Full Code Here

Examples of com.facebook.thrift.transport.TTransportFactory

      Iface handler = new HMSHandler("new db based metaserver");
      FacebookService.Processor processor = new ThriftHiveMetastore.Processor(handler);
      TThreadPoolServer.Options options = new TThreadPoolServer.Options();
      options.minWorkerThreads = 200;
      TServer server = new TThreadPoolServer(processor, serverTransport,
          new TTransportFactory(), new TTransportFactory(),
          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);
      server.serve();
View Full Code Here

Examples of com.facebook.thrift.transport.TTransportFactory

      FacebookService.Processor processor = new ThriftMetaStore.Processor(handler);

      TThreadPoolServer.Options options = new TThreadPoolServer.Options();
      options.minWorkerThreads = 100;
      TServer server = new TThreadPoolServer(processor, serverTransport,
               new TTransportFactory(), new TTransportFactory(),
               new TBinaryProtocol.Factory(), new TBinaryProtocol.Factory(), options);

      ThriftMetaStoreHandler.LOG.info("Starting the metaserver on port [" + port + "]...");

      server.serve();
View Full Code Here

Examples of com.facebook.thrift.transport.TTransportFactory

      Iface handler = new HMSHandler("new db based metaserver");
      FacebookService.Processor processor = new ThriftHiveMetastore.Processor(handler);
      TThreadPoolServer.Options options = new TThreadPoolServer.Options();
      options.minWorkerThreads = 200;
      TServer server = new TThreadPoolServer(processor, serverTransport,
          new TTransportFactory(), new TTransportFactory(),
          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);
      server.serve();
View Full Code Here

Examples of org.apache.thrift.transport.TTransportFactory

    Hbase.Processor<Hbase.Iface> processor =
        new Hbase.Processor<Hbase.Iface>(handler);
    ImplType implType = ImplType.getServerImpl(conf);

    // Construct correct TransportFactory
    TTransportFactory transportFactory;
    if (conf.getBoolean(FRAMED_CONF_KEY, false) || implType.isAlwaysFramed) {
      transportFactory = new TFramedTransport.Factory();
      LOG.debug("Using framed transport");
    } else {
      transportFactory = new TTransportFactory();
    }

    if (conf.get(BIND_CONF_KEY) != null && !implType.canSpecifyBindIP) {
      LOG.error("Server types " + Joiner.on(", ").join(
          ImplType.serversThatCannotSpecifyBindIP()) + " don't support IP " +
View Full Code Here

Examples of org.apache.thrift.transport.TTransportFactory

    // Hive 0.8.0
    ThriftHiveProcessorFactory hfactory = new ThriftHiveProcessorFactory(null, conf);

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

Examples of org.apache.thrift.transport.TTransportFactory

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

Examples of org.apache.thrift.transport.TTransportFactory

    public void prepare(Map storm_conf, Configuration login_conf) {       
        this.login_conf = login_conf;
    }

    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);
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.