예제 #1
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, ConditionalUpdates 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 2: // CONDITIONS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list90 = iprot.readListBegin();
                struct.conditions = new ArrayList<Condition>(_list90.size);
                Condition _elem91;
                for (int _i92 = 0; _i92 < _list90.size; ++_i92) {
                  _elem91 = new Condition();
                  _elem91.read(iprot);
                  struct.conditions.add(_elem91);
                }
                iprot.readListEnd();
              }
              struct.setConditionsIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // UPDATES
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list93 = iprot.readListBegin();
                struct.updates = new ArrayList<ColumnUpdate>(_list93.size);
                ColumnUpdate _elem94;
                for (int _i95 = 0; _i95 < _list93.size; ++_i95) {
                  _elem94 = new ColumnUpdate();
                  _elem94.read(iprot);
                  struct.updates.add(_elem94);
                }
                iprot.readListEnd();
              }
              struct.setUpdatesIsSet(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();
    }
예제 #2
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, ConditionalUpdates struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(2);
   if (incoming.get(0)) {
     {
       org.apache.thrift.protocol.TList _list100 =
           new org.apache.thrift.protocol.TList(
               org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
       struct.conditions = new ArrayList<Condition>(_list100.size);
       Condition _elem101;
       for (int _i102 = 0; _i102 < _list100.size; ++_i102) {
         _elem101 = new Condition();
         _elem101.read(iprot);
         struct.conditions.add(_elem101);
       }
     }
     struct.setConditionsIsSet(true);
   }
   if (incoming.get(1)) {
     {
       org.apache.thrift.protocol.TList _list103 =
           new org.apache.thrift.protocol.TList(
               org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
       struct.updates = new ArrayList<ColumnUpdate>(_list103.size);
       ColumnUpdate _elem104;
       for (int _i105 = 0; _i105 < _list103.size; ++_i105) {
         _elem104 = new ColumnUpdate();
         _elem104.read(iprot);
         struct.updates.add(_elem104);
       }
     }
     struct.setUpdatesIsSet(true);
   }
 }