Package org.apache.blur.thirdparty.thrift_0_9_0.protocol

Examples of org.apache.blur.thirdparty.thrift_0_9_0.protocol.TBinaryProtocol


    socket.setTcpNoDelay(true);
    socket.setSoTimeout(timeout);
    socket.connect(new InetSocketAddress(host, port), timeout);
    trans = new TSocket(socket);

    TProtocol proto = new TBinaryProtocol(new TFramedTransport(trans));
    Client client = new Client(proto);
    return client;
  }
View Full Code Here


    /**
     * Actually invoke the method signified by this FrameBuffer.
     */
    public void invoke() {
      TTransport inTrans = getInputTransport();
      TProtocol inProt = inputProtocolFactory_.getProtocol(inTrans);
      TProtocol outProt = outputProtocolFactory_.getProtocol(getOutputTransport());

      try {
        processorFactory_.getProcessor(inTrans).process(inProt, outProt);
        responseReady();
        return;
View Full Code Here

    while (!stopped_) {
      TTransport client = null;
      TProcessor processor = null;
      TTransport inputTransport = null;
      TTransport outputTransport = null;
      TProtocol inputProtocol = null;
      TProtocol outputProtocol = null;
      ServerContext connectionContext = null;
      try {
        client = serverTransport_.accept();
        if (client != null) {
          processor = processorFactory_.getProcessor(client);
View Full Code Here

    inputTransport_ = inputTransport;
    outputTransport_ = outputTransport;
  }

  private void processUntil(int lastChunk) throws TException {
    TProtocol ip = inputProtocolFactory_.getProtocol(inputTransport_);
    TProtocol op = outputProtocolFactory_.getProtocol(outputTransport_);
    int curChunk = inputTransport_.getCurChunk();

    try {
      while (lastChunk >= curChunk) {
        processor_.process(ip, op);
View Full Code Here

      TTransport transport = new TIOStreamTransport(in, out);
      inTransport = transport;
      outTransport = transport;

      TProtocol inProtocol = inProtocolFactory.getProtocol(inTransport);
      TProtocol outProtocol = outProtocolFactory.getProtocol(outTransport);

      processor.process(inProtocol, outProtocol);
      out.flush();
    } catch (TException te) {
      throw new ServletException(te);
View Full Code Here

   * Initialize buffers.
   * @throws TException if buffer initialization fails
   */
  protected void prepareMethodCall() throws TException {
    TMemoryBuffer memoryBuffer = new TMemoryBuffer(INITIAL_MEMORY_BUFFER_SIZE);
    TProtocol protocol = protocolFactory.getProtocol(memoryBuffer);
    write_args(protocol);

    int length = memoryBuffer.length();
    frameBuffer = ByteBuffer.wrap(memoryBuffer.getArray(), 0, length);

View Full Code Here

    }

    @Override
    public void write(TProtocol oprot, TUnion struct) throws TException {
      if (struct.getSetField() == null || struct.getFieldValue() == null) {
        throw new TProtocolException("Cannot write a TUnion with no set value!");
      }
      oprot.writeStructBegin(struct.getStructDesc());
      oprot.writeFieldBegin(struct.getFieldDesc(struct.setField_));
      struct.standardSchemeWriteValue(oprot);
      oprot.writeFieldEnd();
View Full Code Here

    }

    @Override
    public void write(TProtocol oprot, TUnion struct) throws TException {
      if (struct.getSetField() == null || struct.getFieldValue() == null) {
        throw new TProtocolException("Cannot write a TUnion with no set value!");
      }
      oprot.writeI16(struct.setField_.getThriftFieldId());
      struct.tupleSchemeWriteValue(oprot);
    }
View Full Code Here

  private static class MetricTupleScheme extends TupleScheme<Metric> {

    @Override
    public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, Metric struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetName()) {
        optionals.set(0);
      }
      if (struct.isSetStrMap()) {
        optionals.set(1);
      }
      if (struct.isSetLongMap()) {
        optionals.set(2);
      }
      if (struct.isSetDoubleMap()) {
        optionals.set(3);
      }
      oprot.writeBitSet(optionals, 4);
      if (struct.isSetName()) {
        oprot.writeString(struct.name);
      }
      if (struct.isSetStrMap()) {
        {
          oprot.writeI32(struct.strMap.size());
          for (Map.Entry<String, String> _iter183 : struct.strMap.entrySet())
          {
            oprot.writeString(_iter183.getKey());
            oprot.writeString(_iter183.getValue());
          }
        }
      }
      if (struct.isSetLongMap()) {
        {
          oprot.writeI32(struct.longMap.size());
          for (Map.Entry<String, Long> _iter184 : struct.longMap.entrySet())
          {
            oprot.writeString(_iter184.getKey());
            oprot.writeI64(_iter184.getValue());
          }
        }
      }
      if (struct.isSetDoubleMap()) {
        {
          oprot.writeI32(struct.doubleMap.size());
          for (Map.Entry<String, Double> _iter185 : struct.doubleMap.entrySet())
          {
            oprot.writeString(_iter185.getKey());
            oprot.writeDouble(_iter185.getValue());
          }
        }
      }
    }
View Full Code Here

      }
    }

    @Override
    public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, Metric struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(4);
      if (incoming.get(0)) {
        struct.name = iprot.readString();
        struct.setNameIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map186 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, iprot.readI32());
          struct.strMap = new HashMap<String,String>(2*_map186.size);
          for (int _i187 = 0; _i187 < _map186.size; ++_i187)
          {
            String _key188; // required
            String _val189; // optional
            _key188 = iprot.readString();
            _val189 = iprot.readString();
            struct.strMap.put(_key188, _val189);
          }
        }
        struct.setStrMapIsSet(true);
      }
      if (incoming.get(2)) {
        {
          org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map190 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.I64, iprot.readI32());
          struct.longMap = new HashMap<String,Long>(2*_map190.size);
          for (int _i191 = 0; _i191 < _map190.size; ++_i191)
          {
            String _key192; // required
            long _val193; // optional
            _key192 = iprot.readString();
            _val193 = iprot.readI64();
            struct.longMap.put(_key192, _val193);
          }
        }
        struct.setLongMapIsSet(true);
      }
      if (incoming.get(3)) {
        {
          org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map194 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.DOUBLE, iprot.readI32());
          struct.doubleMap = new HashMap<String,Double>(2*_map194.size);
          for (int _i195 = 0; _i195 < _map194.size; ++_i195)
          {
            String _key196; // required
            double _val197; // optional
            _key196 = iprot.readString();
            _val197 = iprot.readDouble();
            struct.doubleMap.put(_key196, _val197);
          }
        }
        struct.setDoubleMapIsSet(true);
      }
View Full Code Here

TOP

Related Classes of org.apache.blur.thirdparty.thrift_0_9_0.protocol.TBinaryProtocol

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.