Example #1
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, LineageCommand struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(2);
   if (incoming.get(0)) {
     struct.commandType = tachyon.thrift.CommandType.findByValue(iprot.readI32());
     struct.setCommandTypeIsSet(true);
   }
   if (incoming.get(1)) {
     {
       org.apache.thrift.protocol.TList _list13 =
           new org.apache.thrift.protocol.TList(
               org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
       struct.checkpointFiles = new ArrayList<CheckpointFile>(_list13.size);
       CheckpointFile _elem14;
       for (int _i15 = 0; _i15 < _list13.size; ++_i15) {
         _elem14 = new CheckpointFile();
         _elem14.read(iprot);
         struct.checkpointFiles.add(_elem14);
       }
     }
     struct.setCheckpointFilesIsSet(true);
   }
 }
Example #2
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, LineageCommand 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: // COMMAND_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.commandType = tachyon.thrift.CommandType.findByValue(iprot.readI32());
              struct.setCommandTypeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // CHECKPOINT_FILES
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
                struct.checkpointFiles = new ArrayList<CheckpointFile>(_list8.size);
                CheckpointFile _elem9;
                for (int _i10 = 0; _i10 < _list8.size; ++_i10) {
                  _elem9 = new CheckpointFile();
                  _elem9.read(iprot);
                  struct.checkpointFiles.add(_elem9);
                }
                iprot.readListEnd();
              }
              struct.setCheckpointFilesIsSet(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();
    }