Package org.apache.thrift.protocol

Examples of org.apache.thrift.protocol.TTupleProtocol


  private static class TScanTupleScheme extends TupleScheme<TScan> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TScan struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetStartRow()) {
        optionals.set(0);
      }
      if (struct.isSetStopRow()) {
        optionals.set(1);
      }
      if (struct.isSetColumns()) {
        optionals.set(2);
      }
      if (struct.isSetCaching()) {
        optionals.set(3);
      }
      if (struct.isSetMaxVersions()) {
        optionals.set(4);
      }
      if (struct.isSetTimeRange()) {
        optionals.set(5);
      }
      if (struct.isSetFilterString()) {
        optionals.set(6);
      }
      if (struct.isSetBatchSize()) {
        optionals.set(7);
      }
      if (struct.isSetAttributes()) {
        optionals.set(8);
      }
      oprot.writeBitSet(optionals, 9);
      if (struct.isSetStartRow()) {
        oprot.writeBinary(struct.startRow);
      }
      if (struct.isSetStopRow()) {
        oprot.writeBinary(struct.stopRow);
      }
      if (struct.isSetColumns()) {
        {
          oprot.writeI32(struct.columns.size());
          for (TColumn _iter79 : struct.columns)
          {
            _iter79.write(oprot);
          }
        }
      }
      if (struct.isSetCaching()) {
        oprot.writeI32(struct.caching);
      }
      if (struct.isSetMaxVersions()) {
        oprot.writeI32(struct.maxVersions);
      }
      if (struct.isSetTimeRange()) {
        struct.timeRange.write(oprot);
      }
      if (struct.isSetFilterString()) {
        oprot.writeBinary(struct.filterString);
      }
      if (struct.isSetBatchSize()) {
        oprot.writeI32(struct.batchSize);
      }
      if (struct.isSetAttributes()) {
        {
          oprot.writeI32(struct.attributes.size());
          for (Map.Entry<ByteBuffer, ByteBuffer> _iter80 : struct.attributes.entrySet())
          {
            oprot.writeBinary(_iter80.getKey());
            oprot.writeBinary(_iter80.getValue());
          }
        }
      }
    }
View Full Code Here


      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TScan struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(9);
      if (incoming.get(0)) {
        struct.startRow = iprot.readBinary();
        struct.setStartRowIsSet(true);
      }
      if (incoming.get(1)) {
        struct.stopRow = iprot.readBinary();
        struct.setStopRowIsSet(true);
      }
      if (incoming.get(2)) {
        {
          org.apache.thrift.protocol.TList _list81 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.columns = new ArrayList<TColumn>(_list81.size);
          for (int _i82 = 0; _i82 < _list81.size; ++_i82)
          {
            TColumn _elem83; // required
            _elem83 = new TColumn();
            _elem83.read(iprot);
            struct.columns.add(_elem83);
          }
        }
        struct.setColumnsIsSet(true);
      }
      if (incoming.get(3)) {
        struct.caching = iprot.readI32();
        struct.setCachingIsSet(true);
      }
      if (incoming.get(4)) {
        struct.maxVersions = iprot.readI32();
        struct.setMaxVersionsIsSet(true);
      }
      if (incoming.get(5)) {
        struct.timeRange = new TTimeRange();
        struct.timeRange.read(iprot);
        struct.setTimeRangeIsSet(true);
      }
      if (incoming.get(6)) {
        struct.filterString = iprot.readBinary();
        struct.setFilterStringIsSet(true);
      }
      if (incoming.get(7)) {
        struct.batchSize = iprot.readI32();
        struct.setBatchSizeIsSet(true);
      }
      if (incoming.get(8)) {
        {
          org.apache.thrift.protocol.TMap _map84 = 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*_map84.size);
          for (int _i85 = 0; _i85 < _map84.size; ++_i85)
          {
            ByteBuffer _key86; // required
            ByteBuffer _val87; // optional
            _key86 = iprot.readBinary();
            _val87 = iprot.readBinary();
            struct.attributes.put(_key86, _val87);
          }
        }
        struct.setAttributesIsSet(true);
      }
View Full Code Here

  private static class TRowMutationsTupleScheme extends TupleScheme<TRowMutations> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TRowMutations struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      oprot.writeBinary(struct.row);
      {
        oprot.writeI32(struct.mutations.size());
        for (TMutation _iter102 : struct.mutations)
        {
          _iter102.write(oprot);
        }
      }
View Full Code Here

      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TRowMutations struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      struct.row = iprot.readBinary();
      struct.setRowIsSet(true);
      {
        org.apache.thrift.protocol.TList _list103 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
        struct.mutations = new ArrayList<TMutation>(_list103.size);
        for (int _i104 = 0; _i104 < _list103.size; ++_i104)
        {
          TMutation _elem105; // required
          _elem105 = new TMutation();
View Full Code Here

  private static class TGetTupleScheme extends TupleScheme<TGet> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TGet 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.isSetTimeRange()) {
        optionals.set(2);
      }
      if (struct.isSetMaxVersions()) {
        optionals.set(3);
      }
      if (struct.isSetFilterString()) {
        optionals.set(4);
      }
      if (struct.isSetAttributes()) {
        optionals.set(5);
      }
      oprot.writeBitSet(optionals, 6);
      if (struct.isSetColumns()) {
        {
          oprot.writeI32(struct.columns.size());
          for (TColumn _iter17 : struct.columns)
          {
            _iter17.write(oprot);
          }
        }
      }
      if (struct.isSetTimestamp()) {
        oprot.writeI64(struct.timestamp);
      }
      if (struct.isSetTimeRange()) {
        struct.timeRange.write(oprot);
      }
      if (struct.isSetMaxVersions()) {
        oprot.writeI32(struct.maxVersions);
      }
      if (struct.isSetFilterString()) {
        oprot.writeBinary(struct.filterString);
      }
      if (struct.isSetAttributes()) {
        {
          oprot.writeI32(struct.attributes.size());
          for (Map.Entry<ByteBuffer, ByteBuffer> _iter18 : struct.attributes.entrySet())
          {
            oprot.writeBinary(_iter18.getKey());
            oprot.writeBinary(_iter18.getValue());
          }
        }
      }
    }
View Full Code Here

      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TGet 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 _list19 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.columns = new ArrayList<TColumn>(_list19.size);
          for (int _i20 = 0; _i20 < _list19.size; ++_i20)
          {
            TColumn _elem21; // required
            _elem21 = new TColumn();
            _elem21.read(iprot);
            struct.columns.add(_elem21);
          }
        }
        struct.setColumnsIsSet(true);
      }
      if (incoming.get(1)) {
        struct.timestamp = iprot.readI64();
        struct.setTimestampIsSet(true);
      }
      if (incoming.get(2)) {
        struct.timeRange = new TTimeRange();
        struct.timeRange.read(iprot);
        struct.setTimeRangeIsSet(true);
      }
      if (incoming.get(3)) {
        struct.maxVersions = iprot.readI32();
        struct.setMaxVersionsIsSet(true);
      }
      if (incoming.get(4)) {
        struct.filterString = iprot.readBinary();
        struct.setFilterStringIsSet(true);
      }
      if (incoming.get(5)) {
        {
          org.apache.thrift.protocol.TMap _map22 = 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*_map22.size);
          for (int _i23 = 0; _i23 < _map22.size; ++_i23)
          {
            ByteBuffer _key24; // required
            ByteBuffer _val25; // optional
            _key24 = iprot.readBinary();
            _val25 = iprot.readBinary();
            struct.attributes.put(_key24, _val25);
          }
        }
        struct.setAttributesIsSet(true);
      }
View Full Code Here

  private static class TScanTupleScheme extends TupleScheme<TScan> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TScan struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetStartRow()) {
        optionals.set(0);
      }
      if (struct.isSetStopRow()) {
        optionals.set(1);
      }
      if (struct.isSetTimestamp()) {
        optionals.set(2);
      }
      if (struct.isSetColumns()) {
        optionals.set(3);
      }
      if (struct.isSetCaching()) {
        optionals.set(4);
      }
      if (struct.isSetFilterString()) {
        optionals.set(5);
      }
      if (struct.isSetSortColumns()) {
        optionals.set(6);
      }
      oprot.writeBitSet(optionals, 7);
      if (struct.isSetStartRow()) {
        oprot.writeBinary(struct.startRow);
      }
      if (struct.isSetStopRow()) {
        oprot.writeBinary(struct.stopRow);
      }
      if (struct.isSetTimestamp()) {
        oprot.writeI64(struct.timestamp);
      }
      if (struct.isSetColumns()) {
        {
          oprot.writeI32(struct.columns.size());
          for (ByteBuffer _iter30 : struct.columns)
          {
            oprot.writeBinary(_iter30);
          }
        }
      }
      if (struct.isSetCaching()) {
        oprot.writeI32(struct.caching);
      }
      if (struct.isSetFilterString()) {
        oprot.writeBinary(struct.filterString);
      }
      if (struct.isSetSortColumns()) {
        oprot.writeBool(struct.sortColumns);
      }
    }
View Full Code Here

  private static class TPutTupleScheme extends TupleScheme<TPut> {

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

      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TScan struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(7);
      if (incoming.get(0)) {
        struct.startRow = iprot.readBinary();
        struct.setStartRowIsSet(true);
      }
      if (incoming.get(1)) {
        struct.stopRow = iprot.readBinary();
        struct.setStopRowIsSet(true);
      }
      if (incoming.get(2)) {
        struct.timestamp = iprot.readI64();
        struct.setTimestampIsSet(true);
      }
      if (incoming.get(3)) {
        {
          org.apache.thrift.protocol.TList _list31 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.columns = new ArrayList<ByteBuffer>(_list31.size);
          for (int _i32 = 0; _i32 < _list31.size; ++_i32)
          {
            ByteBuffer _elem33; // required
            _elem33 = iprot.readBinary();
            struct.columns.add(_elem33);
          }
        }
        struct.setColumnsIsSet(true);
      }
      if (incoming.get(4)) {
        struct.caching = iprot.readI32();
        struct.setCachingIsSet(true);
      }
      if (incoming.get(5)) {
        struct.filterString = iprot.readBinary();
        struct.setFilterStringIsSet(true);
      }
      if (incoming.get(6)) {
        struct.sortColumns = iprot.readBool();
        struct.setSortColumnsIsSet(true);
      }
    }
View Full Code Here

      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TPut 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.columnValues = new ArrayList<TColumnValue>(_list37.size);
        for (int _i38 = 0; _i38 < _list37.size; ++_i38)
        {
          TColumnValue _elem39; // required
          _elem39 = new TColumnValue();
          _elem39.read(iprot);
          struct.columnValues.add(_elem39);
        }
      }
      struct.setColumnValuesIsSet(true);
      BitSet incoming = iprot.readBitSet(4);
      if (incoming.get(0)) {
        struct.timestamp = iprot.readI64();
        struct.setTimestampIsSet(true);
      }
      if (incoming.get(1)) {
        struct.writeToWal = iprot.readBool();
        struct.setWriteToWalIsSet(true);
      }
      if (incoming.get(2)) {
        {
          org.apache.thrift.protocol.TMap _map40 = 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*_map40.size);
          for (int _i41 = 0; _i41 < _map40.size; ++_i41)
          {
            ByteBuffer _key42; // required
            ByteBuffer _val43; // optional
            _key42 = iprot.readBinary();
            _val43 = iprot.readBinary();
            struct.attributes.put(_key42, _val43);
          }
        }
        struct.setAttributesIsSet(true);
      }
      if (incoming.get(3)) {
        struct.durability = TDurability.findByValue(iprot.readI32());
        struct.setDurabilityIsSet(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.