Esempio n. 1
0
  @Override
  public int compareTo(LineageCommand other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetCommandType()).compareTo(other.isSetCommandType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCommandType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.commandType, other.commandType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetCheckpointFiles()).compareTo(other.isSetCheckpointFiles());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCheckpointFiles()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.checkpointFiles, other.checkpointFiles);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Esempio n. 2
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);
   }
 }
Esempio n. 3
0
 /** Performs a deep copy on <i>other</i>. */
 public LineageCommand(LineageCommand other) {
   if (other.isSetCommandType()) {
     this.commandType = other.commandType;
   }
   if (other.isSetCheckpointFiles()) {
     List<CheckpointFile> __this__checkpointFiles =
         new ArrayList<CheckpointFile>(other.checkpointFiles.size());
     for (CheckpointFile other_element : other.checkpointFiles) {
       __this__checkpointFiles.add(new CheckpointFile(other_element));
     }
     this.checkpointFiles = __this__checkpointFiles;
   }
 }
Esempio n. 4
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, LineageCommand struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.commandType != null) {
        oprot.writeFieldBegin(COMMAND_TYPE_FIELD_DESC);
        oprot.writeI32(struct.commandType.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.checkpointFiles != null) {
        oprot.writeFieldBegin(CHECKPOINT_FILES_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.STRUCT, struct.checkpointFiles.size()));
          for (CheckpointFile _iter11 : struct.checkpointFiles) {
            _iter11.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Esempio n. 5
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();
    }
Esempio n. 6
0
  public boolean equals(LineageCommand that) {
    if (that == null) return false;

    boolean this_present_commandType = true && this.isSetCommandType();
    boolean that_present_commandType = true && that.isSetCommandType();
    if (this_present_commandType || that_present_commandType) {
      if (!(this_present_commandType && that_present_commandType)) return false;
      if (!this.commandType.equals(that.commandType)) return false;
    }

    boolean this_present_checkpointFiles = true && this.isSetCheckpointFiles();
    boolean that_present_checkpointFiles = true && that.isSetCheckpointFiles();
    if (this_present_checkpointFiles || that_present_checkpointFiles) {
      if (!(this_present_checkpointFiles && that_present_checkpointFiles)) return false;
      if (!this.checkpointFiles.equals(that.checkpointFiles)) return false;
    }

    return true;
  }
Esempio n. 7
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, LineageCommand struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetCommandType()) {
     optionals.set(0);
   }
   if (struct.isSetCheckpointFiles()) {
     optionals.set(1);
   }
   oprot.writeBitSet(optionals, 2);
   if (struct.isSetCommandType()) {
     oprot.writeI32(struct.commandType.getValue());
   }
   if (struct.isSetCheckpointFiles()) {
     {
       oprot.writeI32(struct.checkpointFiles.size());
       for (CheckpointFile _iter12 : struct.checkpointFiles) {
         _iter12.write(oprot);
       }
     }
   }
 }