Package org.apache.thrift.protocol

Examples of org.apache.thrift.protocol.TTupleProtocol


  private static class TRowResultTupleScheme extends TupleScheme<TRowResult> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TRowResult struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetRow()) {
        optionals.set(0);
      }
      if (struct.isSetColumns()) {
        optionals.set(1);
      }
      if (struct.isSetSortedColumns()) {
        optionals.set(2);
      }
      oprot.writeBitSet(optionals, 3);
      if (struct.isSetRow()) {
        oprot.writeBinary(struct.row);
      }
      if (struct.isSetColumns()) {
        {
          oprot.writeI32(struct.columns.size());
          for (Map.Entry<ByteBuffer, TCell> _iter17 : struct.columns.entrySet())
          {
            oprot.writeBinary(_iter17.getKey());
            _iter17.getValue().write(oprot);
          }
        }
      }
      if (struct.isSetSortedColumns()) {
        {
          oprot.writeI32(struct.sortedColumns.size());
          for (TColumn _iter18 : struct.sortedColumns)
          {
            _iter18.write(oprot);
          }
        }
View Full Code Here


      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TRowResult struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(3);
      if (incoming.get(0)) {
        struct.row = iprot.readBinary();
        struct.setRowIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TMap _map19 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.columns = new HashMap<ByteBuffer,TCell>(2*_map19.size);
          for (int _i20 = 0; _i20 < _map19.size; ++_i20)
          {
            ByteBuffer _key21; // required
            TCell _val22; // required
            _key21 = iprot.readBinary();
            _val22 = new TCell();
            _val22.read(iprot);
            struct.columns.put(_key21, _val22);
          }
        }
        struct.setColumnsIsSet(true);
      }
      if (incoming.get(2)) {
        {
          org.apache.thrift.protocol.TList _list23 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.sortedColumns = new ArrayList<TColumn>(_list23.size);
          for (int _i24 = 0; _i24 < _list23.size; ++_i24)
          {
            TColumn _elem25; // required
            _elem25 = new TColumn();
View Full Code Here

    private static class getScannerResults_resultTupleScheme extends TupleScheme<getScannerResults_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getScannerResults_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetIo()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          {
            oprot.writeI32(struct.success.size());
            for (TResult _iter148 : struct.success)
            {
              _iter148.write(oprot);
            }
          }
View Full Code Here

        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getScannerResults_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TList _list149 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.success = new ArrayList<TResult>(_list149.size);
            for (int _i150 = 0; _i150 < _list149.size; ++_i150)
            {
              TResult _elem151; // required
              _elem151 = new TResult();
View Full Code Here

  private static class TDeleteTupleScheme extends TupleScheme<TDelete> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TDelete struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      oprot.writeBinary(struct.row);
      BitSet optionals = new BitSet();
      if (struct.isSetColumns()) {
        optionals.set(0);
      }
      if (struct.isSetTimestamp()) {
        optionals.set(1);
      }
      if (struct.isSetDeleteType()) {
        optionals.set(2);
      }
      if (struct.isSetWriteToWal()) {
        optionals.set(3);
      }
      if (struct.isSetAttributes()) {
        optionals.set(4);
      }
      if (struct.isSetDurability()) {
        optionals.set(5);
      }
      oprot.writeBitSet(optionals, 6);
      if (struct.isSetColumns()) {
        {
          oprot.writeI32(struct.columns.size());
          for (TColumn _iter53 : struct.columns)
          {
            _iter53.write(oprot);
          }
        }
      }
      if (struct.isSetTimestamp()) {
        oprot.writeI64(struct.timestamp);
      }
      if (struct.isSetDeleteType()) {
        oprot.writeI32(struct.deleteType.getValue());
      }
      if (struct.isSetWriteToWal()) {
        oprot.writeBool(struct.writeToWal);
      }
      if (struct.isSetAttributes()) {
        {
          oprot.writeI32(struct.attributes.size());
          for (Map.Entry<ByteBuffer, ByteBuffer> _iter54 : struct.attributes.entrySet())
          {
            oprot.writeBinary(_iter54.getKey());
            oprot.writeBinary(_iter54.getValue());
          }
        }
      }
      if (struct.isSetDurability()) {
        oprot.writeI32(struct.durability.getValue());
      }
    }
View Full Code Here

      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TDelete struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      struct.row = iprot.readBinary();
      struct.setRowIsSet(true);
      BitSet incoming = iprot.readBitSet(6);
      if (incoming.get(0)) {
        {
          org.apache.thrift.protocol.TList _list55 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.columns = new ArrayList<TColumn>(_list55.size);
          for (int _i56 = 0; _i56 < _list55.size; ++_i56)
          {
            TColumn _elem57; // required
            _elem57 = new TColumn();
            _elem57.read(iprot);
            struct.columns.add(_elem57);
          }
        }
        struct.setColumnsIsSet(true);
      }
      if (incoming.get(1)) {
        struct.timestamp = iprot.readI64();
        struct.setTimestampIsSet(true);
      }
      if (incoming.get(2)) {
        struct.deleteType = TDeleteType.findByValue(iprot.readI32());
        struct.setDeleteTypeIsSet(true);
      }
      if (incoming.get(3)) {
        struct.writeToWal = iprot.readBool();
        struct.setWriteToWalIsSet(true);
      }
      if (incoming.get(4)) {
        {
          org.apache.thrift.protocol.TMap _map58 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.attributes = new HashMap<ByteBuffer,ByteBuffer>(2*_map58.size);
          for (int _i59 = 0; _i59 < _map58.size; ++_i59)
          {
            ByteBuffer _key60; // required
            ByteBuffer _val61; // optional
            _key60 = iprot.readBinary();
            _val61 = iprot.readBinary();
            struct.attributes.put(_key60, _val61);
          }
        }
        struct.setAttributesIsSet(true);
      }
      if (incoming.get(5)) {
        struct.durability = TDurability.findByValue(iprot.readI32());
        struct.setDurabilityIsSet(true);
      }
    }
View Full Code Here

  private static class TIncrementTupleScheme extends TupleScheme<TIncrement> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TIncrement struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      oprot.writeBinary(struct.row);
      {
        oprot.writeI32(struct.columns.size());
        for (TColumnIncrement _iter36 : struct.columns)
        {
          _iter36.write(oprot);
        }
      }
      BitSet optionals = new BitSet();
      if (struct.isSetWriteToWal()) {
        optionals.set(0);
      }
      oprot.writeBitSet(optionals, 1);
      if (struct.isSetWriteToWal()) {
        oprot.writeBool(struct.writeToWal);
      }
    }
View Full Code Here

      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TIncrement struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      struct.row = iprot.readBinary();
      struct.setRowIsSet(true);
      {
        org.apache.thrift.protocol.TList _list37 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
        struct.columns = new ArrayList<TColumnIncrement>(_list37.size);
        for (int _i38 = 0; _i38 < _list37.size; ++_i38)
        {
          TColumnIncrement _elem39; // required
          _elem39 = new TColumnIncrement();
          _elem39.read(iprot);
          struct.columns.add(_elem39);
        }
      }
      struct.setColumnsIsSet(true);
      BitSet incoming = iprot.readBitSet(1);
      if (incoming.get(0)) {
        struct.writeToWal = iprot.readBool();
        struct.setWriteToWalIsSet(true);
      }
    }
View Full Code Here

  private static class TResultTupleScheme extends TupleScheme<TResult> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TResult struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      {
        oprot.writeI32(struct.columnValues.size());
        for (TColumnValue _iter4 : struct.columnValues)
        {
          _iter4.write(oprot);
        }
      }
      BitSet optionals = new BitSet();
      if (struct.isSetRow()) {
        optionals.set(0);
      }
      oprot.writeBitSet(optionals, 1);
      if (struct.isSetRow()) {
        oprot.writeBinary(struct.row);
      }
    }
View Full Code Here

      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TResult struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      {
        org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
        struct.columnValues = new ArrayList<TColumnValue>(_list5.size);
        for (int _i6 = 0; _i6 < _list5.size; ++_i6)
        {
          TColumnValue _elem7; // required
          _elem7 = new TColumnValue();
          _elem7.read(iprot);
          struct.columnValues.add(_elem7);
        }
      }
      struct.setColumnValuesIsSet(true);
      BitSet incoming = iprot.readBitSet(1);
      if (incoming.get(0)) {
        struct.row = iprot.readBinary();
        struct.setRowIsSet(true);
      }
    }
View Full Code Here

TOP

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

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.