예제 #1
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);
   }
 }
예제 #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;
  }
예제 #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();
    }
예제 #4
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;
  }