示例#1
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, InsertEventRequestData 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: // FILES_ADDED
         if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
           {
             org.apache.thrift.protocol.TList _list558 = iprot.readListBegin();
             struct.filesAdded = new ArrayList<String>(_list558.size);
             String _elem559;
             for (int _i560 = 0; _i560 < _list558.size; ++_i560) {
               _elem559 = iprot.readString();
               struct.filesAdded.add(_elem559);
             }
             iprot.readListEnd();
           }
           struct.setFilesAddedIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // FILES_ADDED_CHECKSUM
         if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
           {
             org.apache.thrift.protocol.TList _list561 = iprot.readListBegin();
             struct.filesAddedChecksum = new ArrayList<ByteBuffer>(_list561.size);
             ByteBuffer _elem562;
             for (int _i563 = 0; _i563 < _list561.size; ++_i563) {
               _elem562 = iprot.readBinary();
               struct.filesAddedChecksum.add(_elem562);
             }
             iprot.readListEnd();
           }
           struct.setFilesAddedChecksumIsSet(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();
   struct.validate();
 }
示例#2
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, InsertEventRequestData struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.filesAdded != null) {
        oprot.writeFieldBegin(FILES_ADDED_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.STRING, struct.filesAdded.size()));
          for (String _iter564 : struct.filesAdded) {
            oprot.writeString(_iter564);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.filesAddedChecksum != null) {
        if (struct.isSetFilesAddedChecksum()) {
          oprot.writeFieldBegin(FILES_ADDED_CHECKSUM_FIELD_DESC);
          {
            oprot.writeListBegin(
                new org.apache.thrift.protocol.TList(
                    org.apache.thrift.protocol.TType.STRING, struct.filesAddedChecksum.size()));
            for (ByteBuffer _iter565 : struct.filesAddedChecksum) {
              oprot.writeBinary(_iter565);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }