Exemplo n.º 1
0
 @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);
   }
 }
Exemplo n.º 2
0
 @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 _list81 =
         new org.apache.thrift.protocol.TList(
             org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
     struct.columns = new ArrayList<TColumnIncrement>(_list81.size);
     for (int _i82 = 0; _i82 < _list81.size; ++_i82) {
       TColumnIncrement _elem83; // required
       _elem83 = new TColumnIncrement();
       _elem83.read(iprot);
       struct.columns.add(_elem83);
     }
   }
   struct.setColumnsIsSet(true);
   BitSet incoming = iprot.readBitSet(3);
   if (incoming.get(0)) {
     {
       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; // required
         _key86 = iprot.readBinary();
         _val87 = iprot.readBinary();
         struct.attributes.put(_key86, _val87);
       }
     }
     struct.setAttributesIsSet(true);
   }
   if (incoming.get(1)) {
     struct.durability = TDurability.findByValue(iprot.readI32());
     struct.setDurabilityIsSet(true);
   }
   if (incoming.get(2)) {
     struct.cellVisibility = new TCellVisibility();
     struct.cellVisibility.read(iprot);
     struct.setCellVisibilityIsSet(true);
   }
 }
Exemplo n.º 3
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, TDelete struct)
        throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true) {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // ROW
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.row = iprot.readBinary();
              struct.setRowIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // COLUMNS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list44 = iprot.readListBegin();
                struct.columns = new ArrayList<TColumn>(_list44.size);
                for (int _i45 = 0; _i45 < _list44.size; ++_i45) {
                  TColumn _elem46; // required
                  _elem46 = new TColumn();
                  _elem46.read(iprot);
                  struct.columns.add(_elem46);
                }
                iprot.readListEnd();
              }
              struct.setColumnsIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // TIMESTAMP
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.timestamp = iprot.readI64();
              struct.setTimestampIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // DELETE_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.deleteType = TDeleteType.findByValue(iprot.readI32());
              struct.setDeleteTypeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // WRITE_TO_WAL
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.writeToWal = iprot.readBool();
              struct.setWriteToWalIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // ATTRIBUTES
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map47 = iprot.readMapBegin();
                struct.attributes = new HashMap<ByteBuffer, ByteBuffer>(2 * _map47.size);
                for (int _i48 = 0; _i48 < _map47.size; ++_i48) {
                  ByteBuffer _key49; // required
                  ByteBuffer _val50; // optional
                  _key49 = iprot.readBinary();
                  _val50 = iprot.readBinary();
                  struct.attributes.put(_key49, _val50);
                }
                iprot.readMapEnd();
              }
              struct.setAttributesIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // DURABILITY
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.durability = TDurability.findByValue(iprot.readI32());
              struct.setDurabilityIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }
Exemplo n.º 4
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, TIncrement struct)
        throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true) {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // ROW
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.row = iprot.readBinary();
              struct.setRowIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // COLUMNS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list70 = iprot.readListBegin();
                struct.columns = new ArrayList<TColumnIncrement>(_list70.size);
                for (int _i71 = 0; _i71 < _list70.size; ++_i71) {
                  TColumnIncrement _elem72; // required
                  _elem72 = new TColumnIncrement();
                  _elem72.read(iprot);
                  struct.columns.add(_elem72);
                }
                iprot.readListEnd();
              }
              struct.setColumnsIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // ATTRIBUTES
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map73 = iprot.readMapBegin();
                struct.attributes = new HashMap<ByteBuffer, ByteBuffer>(2 * _map73.size);
                for (int _i74 = 0; _i74 < _map73.size; ++_i74) {
                  ByteBuffer _key75; // required
                  ByteBuffer _val76; // required
                  _key75 = iprot.readBinary();
                  _val76 = iprot.readBinary();
                  struct.attributes.put(_key75, _val76);
                }
                iprot.readMapEnd();
              }
              struct.setAttributesIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // DURABILITY
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.durability = TDurability.findByValue(iprot.readI32());
              struct.setDurabilityIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // CELL_VISIBILITY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.cellVisibility = new TCellVisibility();
              struct.cellVisibility.read(iprot);
              struct.setCellVisibilityIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }