Package org.apache.thrift.protocol

Examples of org.apache.thrift.protocol.TProtocolFactory


  /**
   * Setting up the thrift TServer
   */
  private void setupServer() throws Exception {
    // Construct correct ProtocolFactory
    TProtocolFactory protocolFactory;
    if (conf.getBoolean(COMPACT_CONF_KEY, false)) {
      LOG.debug("Using compact protocol");
      protocolFactory = new TCompactProtocol.Factory();
    } else {
      LOG.debug("Using binary protocol");
View Full Code Here


      // Transport
      TServerSocket tServerSocket =
        new TServerSocket(port);

      // Protocol factory
      TProtocolFactory tProtocolFactory =
        new TBinaryProtocol.Factory();

      TServer serverEngine;

      // Simple Server
View Full Code Here

    try {
      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();
View Full Code Here

        // Transport
        TServerSocket tServerSocket = new TServerSocket(new InetSocketAddress(FBUtilities.getHostName(), listenPort));

        // Protocol factory
        TProtocolFactory tProtocolFactory = new TBinaryProtocol.Factory();

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

            for (final LogEntry logEntry : messages) {
                final byte[] decodedSpan = base64.decode(logEntry.getMessage());

                final ByteArrayInputStream buf = new ByteArrayInputStream(decodedSpan);
                final TProtocolFactory factory = new TBinaryProtocol.Factory();
                final TProtocol proto = factory.getProtocol(new TIOStreamTransport(buf));
                final Span span = new Span();
                span.read(proto);
                spans.add(span);
            }
View Full Code Here

    private void process(final LogEntry logEntry) throws TException, IOException {
        final Base64 base64 = new Base64();
        final byte[] decodedSpan = base64.decode(logEntry.getMessage());

        final ByteArrayInputStream buf = new ByteArrayInputStream(decodedSpan);
        final TProtocolFactory factory = new TBinaryProtocol.Factory();
        final TProtocol proto = factory.getProtocol(new TIOStreamTransport(buf));
        final Span span = new Span();
        span.read(proto);

        for (final Annotation annotation : span.getAnnotations()) {
            int duration = annotation.getDuration();
View Full Code Here

  /**
   * Setting up the thrift TServer
   */
  private void setupServer() throws Exception {
    // Construct correct ProtocolFactory
    TProtocolFactory protocolFactory;
    if (conf.getBoolean(COMPACT_CONF_KEY, false)) {
      LOG.debug("Using compact protocol");
      protocolFactory = new TCompactProtocol.Factory();
    } else {
      LOG.debug("Using binary protocol");
View Full Code Here

            }

            logger.info(String.format("Binding thrift service to %s:%s", listenAddr, listenPort));

            // Protocol factory
            TProtocolFactory tProtocolFactory = new TBinaryProtocol.Factory(true,
                    true,
                    DatabaseDescriptor.getThriftMaxMessageLength());

            // Transport factory
            TTransportFactory inTransportFactory, outTransportFactory;
View Full Code Here

      registerFilters(conf);

      // Construct correct ProtocolFactory
      boolean compact = cmd.hasOption("compact") ||
        conf.getBoolean("hbase.regionserver.thrift.compact", false);
      TProtocolFactory protocolFactory = getTProtocolFactory(compact);
      THBaseService.Iface handler =
          ThriftHBaseServiceHandler.newInstance(conf, metrics);
      THBaseService.Processor processor = new THBaseService.Processor(handler);
      conf.setBoolean("hbase.regionserver.thrift.compact", compact);
View Full Code Here

  /**
   * Setting up the thrift TServer
   */
  private void setupServer() throws Exception {
    // Construct correct ProtocolFactory
    TProtocolFactory protocolFactory;
    if (conf.getBoolean(COMPACT_CONF_KEY, false)) {
      LOG.debug("Using compact protocol");
      protocolFactory = new TCompactProtocol.Factory();
    } else {
      LOG.debug("Using binary protocol");
View Full Code Here

TOP

Related Classes of org.apache.thrift.protocol.TProtocolFactory

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.