Пример #1
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, PersistFile 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: // FILE_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.fileId = iprot.readI64();
              struct.setFileIdIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // BLOCK_IDS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
                struct.blockIds = new ArrayList<Long>(_list16.size);
                long _elem17;
                for (int _i18 = 0; _i18 < _list16.size; ++_i18) {
                  _elem17 = iprot.readI64();
                  struct.blockIds.add(_elem17);
                }
                iprot.readListEnd();
              }
              struct.setBlockIdsIsSet(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, PersistFile struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(2);
   if (incoming.get(0)) {
     struct.fileId = iprot.readI64();
     struct.setFileIdIsSet(true);
   }
   if (incoming.get(1)) {
     {
       org.apache.thrift.protocol.TList _list21 =
           new org.apache.thrift.protocol.TList(
               org.apache.thrift.protocol.TType.I64, iprot.readI32());
       struct.blockIds = new ArrayList<Long>(_list21.size);
       long _elem22;
       for (int _i23 = 0; _i23 < _list21.size; ++_i23) {
         _elem22 = iprot.readI64();
         struct.blockIds.add(_elem22);
       }
     }
     struct.setBlockIdsIsSet(true);
   }
 }