Example #1
0
 /** Performs a deep copy on <i>other</i>. */
 public BatchQueue(BatchQueue other) {
   __isset_bitfield = other.__isset_bitfield;
   if (other.isSetQueueName()) {
     this.queueName = other.queueName;
   }
   if (other.isSetQueueDescription()) {
     this.queueDescription = other.queueDescription;
   }
   this.maxRunTime = other.maxRunTime;
   this.maxNodes = other.maxNodes;
   this.maxProcessors = other.maxProcessors;
   this.maxJobsInQueue = other.maxJobsInQueue;
   this.maxMemory = other.maxMemory;
 }
Example #2
0
  public boolean equals(BatchQueue that) {
    if (that == null) return false;

    boolean this_present_queueName = true && this.isSetQueueName();
    boolean that_present_queueName = true && that.isSetQueueName();
    if (this_present_queueName || that_present_queueName) {
      if (!(this_present_queueName && that_present_queueName)) return false;
      if (!this.queueName.equals(that.queueName)) return false;
    }

    boolean this_present_queueDescription = true && this.isSetQueueDescription();
    boolean that_present_queueDescription = true && that.isSetQueueDescription();
    if (this_present_queueDescription || that_present_queueDescription) {
      if (!(this_present_queueDescription && that_present_queueDescription)) return false;
      if (!this.queueDescription.equals(that.queueDescription)) return false;
    }

    boolean this_present_maxRunTime = true && this.isSetMaxRunTime();
    boolean that_present_maxRunTime = true && that.isSetMaxRunTime();
    if (this_present_maxRunTime || that_present_maxRunTime) {
      if (!(this_present_maxRunTime && that_present_maxRunTime)) return false;
      if (this.maxRunTime != that.maxRunTime) return false;
    }

    boolean this_present_maxNodes = true && this.isSetMaxNodes();
    boolean that_present_maxNodes = true && that.isSetMaxNodes();
    if (this_present_maxNodes || that_present_maxNodes) {
      if (!(this_present_maxNodes && that_present_maxNodes)) return false;
      if (this.maxNodes != that.maxNodes) return false;
    }

    boolean this_present_maxProcessors = true && this.isSetMaxProcessors();
    boolean that_present_maxProcessors = true && that.isSetMaxProcessors();
    if (this_present_maxProcessors || that_present_maxProcessors) {
      if (!(this_present_maxProcessors && that_present_maxProcessors)) return false;
      if (this.maxProcessors != that.maxProcessors) return false;
    }

    boolean this_present_maxJobsInQueue = true && this.isSetMaxJobsInQueue();
    boolean that_present_maxJobsInQueue = true && that.isSetMaxJobsInQueue();
    if (this_present_maxJobsInQueue || that_present_maxJobsInQueue) {
      if (!(this_present_maxJobsInQueue && that_present_maxJobsInQueue)) return false;
      if (this.maxJobsInQueue != that.maxJobsInQueue) return false;
    }

    boolean this_present_maxMemory = true && this.isSetMaxMemory();
    boolean that_present_maxMemory = true && that.isSetMaxMemory();
    if (this_present_maxMemory || that_present_maxMemory) {
      if (!(this_present_maxMemory && that_present_maxMemory)) return false;
      if (this.maxMemory != that.maxMemory) return false;
    }

    return true;
  }
Example #3
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, BatchQueue struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.queueName != null) {
        oprot.writeFieldBegin(QUEUE_NAME_FIELD_DESC);
        oprot.writeString(struct.queueName);
        oprot.writeFieldEnd();
      }
      if (struct.queueDescription != null) {
        if (struct.isSetQueueDescription()) {
          oprot.writeFieldBegin(QUEUE_DESCRIPTION_FIELD_DESC);
          oprot.writeString(struct.queueDescription);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetMaxRunTime()) {
        oprot.writeFieldBegin(MAX_RUN_TIME_FIELD_DESC);
        oprot.writeI32(struct.maxRunTime);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMaxNodes()) {
        oprot.writeFieldBegin(MAX_NODES_FIELD_DESC);
        oprot.writeI32(struct.maxNodes);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMaxProcessors()) {
        oprot.writeFieldBegin(MAX_PROCESSORS_FIELD_DESC);
        oprot.writeI32(struct.maxProcessors);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMaxJobsInQueue()) {
        oprot.writeFieldBegin(MAX_JOBS_IN_QUEUE_FIELD_DESC);
        oprot.writeI32(struct.maxJobsInQueue);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMaxMemory()) {
        oprot.writeFieldBegin(MAX_MEMORY_FIELD_DESC);
        oprot.writeI32(struct.maxMemory);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Example #4
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, BatchQueue struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   oprot.writeString(struct.queueName);
   BitSet optionals = new BitSet();
   if (struct.isSetQueueDescription()) {
     optionals.set(0);
   }
   if (struct.isSetMaxRunTime()) {
     optionals.set(1);
   }
   if (struct.isSetMaxNodes()) {
     optionals.set(2);
   }
   if (struct.isSetMaxProcessors()) {
     optionals.set(3);
   }
   if (struct.isSetMaxJobsInQueue()) {
     optionals.set(4);
   }
   if (struct.isSetMaxMemory()) {
     optionals.set(5);
   }
   oprot.writeBitSet(optionals, 6);
   if (struct.isSetQueueDescription()) {
     oprot.writeString(struct.queueDescription);
   }
   if (struct.isSetMaxRunTime()) {
     oprot.writeI32(struct.maxRunTime);
   }
   if (struct.isSetMaxNodes()) {
     oprot.writeI32(struct.maxNodes);
   }
   if (struct.isSetMaxProcessors()) {
     oprot.writeI32(struct.maxProcessors);
   }
   if (struct.isSetMaxJobsInQueue()) {
     oprot.writeI32(struct.maxJobsInQueue);
   }
   if (struct.isSetMaxMemory()) {
     oprot.writeI32(struct.maxMemory);
   }
 }
Example #5
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, BatchQueue 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: // QUEUE_NAME
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.queueName = iprot.readString();
           struct.setQueueNameIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // QUEUE_DESCRIPTION
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.queueDescription = iprot.readString();
           struct.setQueueDescriptionIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 3: // MAX_RUN_TIME
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.maxRunTime = iprot.readI32();
           struct.setMaxRunTimeIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4: // MAX_NODES
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.maxNodes = iprot.readI32();
           struct.setMaxNodesIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 5: // MAX_PROCESSORS
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.maxProcessors = iprot.readI32();
           struct.setMaxProcessorsIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 6: // MAX_JOBS_IN_QUEUE
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.maxJobsInQueue = iprot.readI32();
           struct.setMaxJobsInQueueIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 7: // MAX_MEMORY
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.maxMemory = iprot.readI32();
           struct.setMaxMemoryIsSet(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();
 }
Example #6
0
  @Override
  public int compareTo(BatchQueue other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetQueueName()).compareTo(other.isSetQueueName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetQueueName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queueName, other.queueName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetQueueDescription()).compareTo(other.isSetQueueDescription());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetQueueDescription()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.queueDescription, other.queueDescription);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMaxRunTime()).compareTo(other.isSetMaxRunTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMaxRunTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxRunTime, other.maxRunTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMaxNodes()).compareTo(other.isSetMaxNodes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMaxNodes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxNodes, other.maxNodes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMaxProcessors()).compareTo(other.isSetMaxProcessors());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMaxProcessors()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.maxProcessors, other.maxProcessors);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMaxJobsInQueue()).compareTo(other.isSetMaxJobsInQueue());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMaxJobsInQueue()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.maxJobsInQueue, other.maxJobsInQueue);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMaxMemory()).compareTo(other.isSetMaxMemory());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMaxMemory()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxMemory, other.maxMemory);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Example #7
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, BatchQueue struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   struct.queueName = iprot.readString();
   struct.setQueueNameIsSet(true);
   BitSet incoming = iprot.readBitSet(6);
   if (incoming.get(0)) {
     struct.queueDescription = iprot.readString();
     struct.setQueueDescriptionIsSet(true);
   }
   if (incoming.get(1)) {
     struct.maxRunTime = iprot.readI32();
     struct.setMaxRunTimeIsSet(true);
   }
   if (incoming.get(2)) {
     struct.maxNodes = iprot.readI32();
     struct.setMaxNodesIsSet(true);
   }
   if (incoming.get(3)) {
     struct.maxProcessors = iprot.readI32();
     struct.setMaxProcessorsIsSet(true);
   }
   if (incoming.get(4)) {
     struct.maxJobsInQueue = iprot.readI32();
     struct.setMaxJobsInQueueIsSet(true);
   }
   if (incoming.get(5)) {
     struct.maxMemory = iprot.readI32();
     struct.setMaxMemoryIsSet(true);
   }
 }