You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2016/11/08 18:47:33 UTC
airavata git commit: adding thrift generated file
Repository: airavata
Updated Branches:
refs/heads/develop 2ea1e88eb -> b8977a7ec
adding thrift generated file
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/b8977a7e
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/b8977a7e
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/b8977a7e
Branch: refs/heads/develop
Commit: b8977a7ecbfbbc9c3243b0fb74d764b771ccba34
Parents: 2ea1e88
Author: scnakandala <su...@gmail.com>
Authored: Tue Nov 8 13:47:28 2016 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Tue Nov 8 13:47:28 2016 -0500
----------------------------------------------------------------------
.../airavata/model/status/QueueStatusModel.java | 891 +++++++++++++++++++
1 file changed, 891 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/b8977a7e/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/status/QueueStatusModel.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/status/QueueStatusModel.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/status/QueueStatusModel.java
new file mode 100644
index 0000000..8d3b45f
--- /dev/null
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/status/QueueStatusModel.java
@@ -0,0 +1,891 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.airavata.model.status;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
+public class QueueStatusModel implements org.apache.thrift.TBase<QueueStatusModel, QueueStatusModel._Fields>, java.io.Serializable, Cloneable, Comparable<QueueStatusModel> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("QueueStatusModel");
+
+ private static final org.apache.thrift.protocol.TField HOST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("hostName", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField QUEUE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("queueName", org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField QUEUE_UP_FIELD_DESC = new org.apache.thrift.protocol.TField("queueUp", org.apache.thrift.protocol.TType.BOOL, (short)3);
+ private static final org.apache.thrift.protocol.TField RUNNING_JOBS_FIELD_DESC = new org.apache.thrift.protocol.TField("runningJobs", org.apache.thrift.protocol.TType.I32, (short)4);
+ private static final org.apache.thrift.protocol.TField QUEUED_JOBS_FIELD_DESC = new org.apache.thrift.protocol.TField("queuedJobs", org.apache.thrift.protocol.TType.I32, (short)5);
+ private static final org.apache.thrift.protocol.TField TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("time", org.apache.thrift.protocol.TType.I64, (short)6);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new QueueStatusModelStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new QueueStatusModelTupleSchemeFactory());
+ }
+
+ private String hostName; // required
+ private String queueName; // required
+ private boolean queueUp; // required
+ private int runningJobs; // required
+ private int queuedJobs; // required
+ private long time; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ HOST_NAME((short)1, "hostName"),
+ QUEUE_NAME((short)2, "queueName"),
+ QUEUE_UP((short)3, "queueUp"),
+ RUNNING_JOBS((short)4, "runningJobs"),
+ QUEUED_JOBS((short)5, "queuedJobs"),
+ TIME((short)6, "time");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 1: // HOST_NAME
+ return HOST_NAME;
+ case 2: // QUEUE_NAME
+ return QUEUE_NAME;
+ case 3: // QUEUE_UP
+ return QUEUE_UP;
+ case 4: // RUNNING_JOBS
+ return RUNNING_JOBS;
+ case 5: // QUEUED_JOBS
+ return QUEUED_JOBS;
+ case 6: // TIME
+ return TIME;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ private static final int __QUEUEUP_ISSET_ID = 0;
+ private static final int __RUNNINGJOBS_ISSET_ID = 1;
+ private static final int __QUEUEDJOBS_ISSET_ID = 2;
+ private static final int __TIME_ISSET_ID = 3;
+ private byte __isset_bitfield = 0;
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.HOST_NAME, new org.apache.thrift.meta_data.FieldMetaData("hostName", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.QUEUE_NAME, new org.apache.thrift.meta_data.FieldMetaData("queueName", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.QUEUE_UP, new org.apache.thrift.meta_data.FieldMetaData("queueUp", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.RUNNING_JOBS, new org.apache.thrift.meta_data.FieldMetaData("runningJobs", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+ tmpMap.put(_Fields.QUEUED_JOBS, new org.apache.thrift.meta_data.FieldMetaData("queuedJobs", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+ tmpMap.put(_Fields.TIME, new org.apache.thrift.meta_data.FieldMetaData("time", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(QueueStatusModel.class, metaDataMap);
+ }
+
+ public QueueStatusModel() {
+ }
+
+ public QueueStatusModel(
+ String hostName,
+ String queueName,
+ boolean queueUp,
+ int runningJobs,
+ int queuedJobs,
+ long time)
+ {
+ this();
+ this.hostName = hostName;
+ this.queueName = queueName;
+ this.queueUp = queueUp;
+ setQueueUpIsSet(true);
+ this.runningJobs = runningJobs;
+ setRunningJobsIsSet(true);
+ this.queuedJobs = queuedJobs;
+ setQueuedJobsIsSet(true);
+ this.time = time;
+ setTimeIsSet(true);
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public QueueStatusModel(QueueStatusModel other) {
+ __isset_bitfield = other.__isset_bitfield;
+ if (other.isSetHostName()) {
+ this.hostName = other.hostName;
+ }
+ if (other.isSetQueueName()) {
+ this.queueName = other.queueName;
+ }
+ this.queueUp = other.queueUp;
+ this.runningJobs = other.runningJobs;
+ this.queuedJobs = other.queuedJobs;
+ this.time = other.time;
+ }
+
+ public QueueStatusModel deepCopy() {
+ return new QueueStatusModel(this);
+ }
+
+ @Override
+ public void clear() {
+ this.hostName = null;
+ this.queueName = null;
+ setQueueUpIsSet(false);
+ this.queueUp = false;
+ setRunningJobsIsSet(false);
+ this.runningJobs = 0;
+ setQueuedJobsIsSet(false);
+ this.queuedJobs = 0;
+ setTimeIsSet(false);
+ this.time = 0;
+ }
+
+ public String getHostName() {
+ return this.hostName;
+ }
+
+ public void setHostName(String hostName) {
+ this.hostName = hostName;
+ }
+
+ public void unsetHostName() {
+ this.hostName = null;
+ }
+
+ /** Returns true if field hostName is set (has been assigned a value) and false otherwise */
+ public boolean isSetHostName() {
+ return this.hostName != null;
+ }
+
+ public void setHostNameIsSet(boolean value) {
+ if (!value) {
+ this.hostName = null;
+ }
+ }
+
+ public String getQueueName() {
+ return this.queueName;
+ }
+
+ public void setQueueName(String queueName) {
+ this.queueName = queueName;
+ }
+
+ public void unsetQueueName() {
+ this.queueName = null;
+ }
+
+ /** Returns true if field queueName is set (has been assigned a value) and false otherwise */
+ public boolean isSetQueueName() {
+ return this.queueName != null;
+ }
+
+ public void setQueueNameIsSet(boolean value) {
+ if (!value) {
+ this.queueName = null;
+ }
+ }
+
+ public boolean isQueueUp() {
+ return this.queueUp;
+ }
+
+ public void setQueueUp(boolean queueUp) {
+ this.queueUp = queueUp;
+ setQueueUpIsSet(true);
+ }
+
+ public void unsetQueueUp() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __QUEUEUP_ISSET_ID);
+ }
+
+ /** Returns true if field queueUp is set (has been assigned a value) and false otherwise */
+ public boolean isSetQueueUp() {
+ return EncodingUtils.testBit(__isset_bitfield, __QUEUEUP_ISSET_ID);
+ }
+
+ public void setQueueUpIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __QUEUEUP_ISSET_ID, value);
+ }
+
+ public int getRunningJobs() {
+ return this.runningJobs;
+ }
+
+ public void setRunningJobs(int runningJobs) {
+ this.runningJobs = runningJobs;
+ setRunningJobsIsSet(true);
+ }
+
+ public void unsetRunningJobs() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RUNNINGJOBS_ISSET_ID);
+ }
+
+ /** Returns true if field runningJobs is set (has been assigned a value) and false otherwise */
+ public boolean isSetRunningJobs() {
+ return EncodingUtils.testBit(__isset_bitfield, __RUNNINGJOBS_ISSET_ID);
+ }
+
+ public void setRunningJobsIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RUNNINGJOBS_ISSET_ID, value);
+ }
+
+ public int getQueuedJobs() {
+ return this.queuedJobs;
+ }
+
+ public void setQueuedJobs(int queuedJobs) {
+ this.queuedJobs = queuedJobs;
+ setQueuedJobsIsSet(true);
+ }
+
+ public void unsetQueuedJobs() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __QUEUEDJOBS_ISSET_ID);
+ }
+
+ /** Returns true if field queuedJobs is set (has been assigned a value) and false otherwise */
+ public boolean isSetQueuedJobs() {
+ return EncodingUtils.testBit(__isset_bitfield, __QUEUEDJOBS_ISSET_ID);
+ }
+
+ public void setQueuedJobsIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __QUEUEDJOBS_ISSET_ID, value);
+ }
+
+ public long getTime() {
+ return this.time;
+ }
+
+ public void setTime(long time) {
+ this.time = time;
+ setTimeIsSet(true);
+ }
+
+ public void unsetTime() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIME_ISSET_ID);
+ }
+
+ /** Returns true if field time is set (has been assigned a value) and false otherwise */
+ public boolean isSetTime() {
+ return EncodingUtils.testBit(__isset_bitfield, __TIME_ISSET_ID);
+ }
+
+ public void setTimeIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIME_ISSET_ID, value);
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case HOST_NAME:
+ if (value == null) {
+ unsetHostName();
+ } else {
+ setHostName((String)value);
+ }
+ break;
+
+ case QUEUE_NAME:
+ if (value == null) {
+ unsetQueueName();
+ } else {
+ setQueueName((String)value);
+ }
+ break;
+
+ case QUEUE_UP:
+ if (value == null) {
+ unsetQueueUp();
+ } else {
+ setQueueUp((Boolean)value);
+ }
+ break;
+
+ case RUNNING_JOBS:
+ if (value == null) {
+ unsetRunningJobs();
+ } else {
+ setRunningJobs((Integer)value);
+ }
+ break;
+
+ case QUEUED_JOBS:
+ if (value == null) {
+ unsetQueuedJobs();
+ } else {
+ setQueuedJobs((Integer)value);
+ }
+ break;
+
+ case TIME:
+ if (value == null) {
+ unsetTime();
+ } else {
+ setTime((Long)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case HOST_NAME:
+ return getHostName();
+
+ case QUEUE_NAME:
+ return getQueueName();
+
+ case QUEUE_UP:
+ return isQueueUp();
+
+ case RUNNING_JOBS:
+ return getRunningJobs();
+
+ case QUEUED_JOBS:
+ return getQueuedJobs();
+
+ case TIME:
+ return getTime();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case HOST_NAME:
+ return isSetHostName();
+ case QUEUE_NAME:
+ return isSetQueueName();
+ case QUEUE_UP:
+ return isSetQueueUp();
+ case RUNNING_JOBS:
+ return isSetRunningJobs();
+ case QUEUED_JOBS:
+ return isSetQueuedJobs();
+ case TIME:
+ return isSetTime();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof QueueStatusModel)
+ return this.equals((QueueStatusModel)that);
+ return false;
+ }
+
+ public boolean equals(QueueStatusModel that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_hostName = true && this.isSetHostName();
+ boolean that_present_hostName = true && that.isSetHostName();
+ if (this_present_hostName || that_present_hostName) {
+ if (!(this_present_hostName && that_present_hostName))
+ return false;
+ if (!this.hostName.equals(that.hostName))
+ 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_queueUp = true;
+ boolean that_present_queueUp = true;
+ if (this_present_queueUp || that_present_queueUp) {
+ if (!(this_present_queueUp && that_present_queueUp))
+ return false;
+ if (this.queueUp != that.queueUp)
+ return false;
+ }
+
+ boolean this_present_runningJobs = true;
+ boolean that_present_runningJobs = true;
+ if (this_present_runningJobs || that_present_runningJobs) {
+ if (!(this_present_runningJobs && that_present_runningJobs))
+ return false;
+ if (this.runningJobs != that.runningJobs)
+ return false;
+ }
+
+ boolean this_present_queuedJobs = true;
+ boolean that_present_queuedJobs = true;
+ if (this_present_queuedJobs || that_present_queuedJobs) {
+ if (!(this_present_queuedJobs && that_present_queuedJobs))
+ return false;
+ if (this.queuedJobs != that.queuedJobs)
+ return false;
+ }
+
+ boolean this_present_time = true;
+ boolean that_present_time = true;
+ if (this_present_time || that_present_time) {
+ if (!(this_present_time && that_present_time))
+ return false;
+ if (this.time != that.time)
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_hostName = true && (isSetHostName());
+ list.add(present_hostName);
+ if (present_hostName)
+ list.add(hostName);
+
+ boolean present_queueName = true && (isSetQueueName());
+ list.add(present_queueName);
+ if (present_queueName)
+ list.add(queueName);
+
+ boolean present_queueUp = true;
+ list.add(present_queueUp);
+ if (present_queueUp)
+ list.add(queueUp);
+
+ boolean present_runningJobs = true;
+ list.add(present_runningJobs);
+ if (present_runningJobs)
+ list.add(runningJobs);
+
+ boolean present_queuedJobs = true;
+ list.add(present_queuedJobs);
+ if (present_queuedJobs)
+ list.add(queuedJobs);
+
+ boolean present_time = true;
+ list.add(present_time);
+ if (present_time)
+ list.add(time);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(QueueStatusModel other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetHostName()).compareTo(other.isSetHostName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetHostName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hostName, other.hostName);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ 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(isSetQueueUp()).compareTo(other.isSetQueueUp());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetQueueUp()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queueUp, other.queueUp);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetRunningJobs()).compareTo(other.isSetRunningJobs());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetRunningJobs()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.runningJobs, other.runningJobs);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetQueuedJobs()).compareTo(other.isSetQueuedJobs());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetQueuedJobs()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queuedJobs, other.queuedJobs);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetTime()).compareTo(other.isSetTime());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetTime()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.time, other.time);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("QueueStatusModel(");
+ boolean first = true;
+
+ sb.append("hostName:");
+ if (this.hostName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.hostName);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("queueName:");
+ if (this.queueName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.queueName);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("queueUp:");
+ sb.append(this.queueUp);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("runningJobs:");
+ sb.append(this.runningJobs);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("queuedJobs:");
+ sb.append(this.queuedJobs);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("time:");
+ sb.append(this.time);
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (!isSetHostName()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'hostName' is unset! Struct:" + toString());
+ }
+
+ if (!isSetQueueName()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'queueName' is unset! Struct:" + toString());
+ }
+
+ if (!isSetQueueUp()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'queueUp' is unset! Struct:" + toString());
+ }
+
+ if (!isSetRunningJobs()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'runningJobs' is unset! Struct:" + toString());
+ }
+
+ if (!isSetQueuedJobs()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'queuedJobs' is unset! Struct:" + toString());
+ }
+
+ if (!isSetTime()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'time' is unset! Struct:" + toString());
+ }
+
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+ __isset_bitfield = 0;
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class QueueStatusModelStandardSchemeFactory implements SchemeFactory {
+ public QueueStatusModelStandardScheme getScheme() {
+ return new QueueStatusModelStandardScheme();
+ }
+ }
+
+ private static class QueueStatusModelStandardScheme extends StandardScheme<QueueStatusModel> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, QueueStatusModel 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: // HOST_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.hostName = iprot.readString();
+ struct.setHostNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // 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 3: // QUEUE_UP
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.queueUp = iprot.readBool();
+ struct.setQueueUpIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // RUNNING_JOBS
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.runningJobs = iprot.readI32();
+ struct.setRunningJobsIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // QUEUED_JOBS
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.queuedJobs = iprot.readI32();
+ struct.setQueuedJobsIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 6: // TIME
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.time = iprot.readI64();
+ struct.setTimeIsSet(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();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, QueueStatusModel struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.hostName != null) {
+ oprot.writeFieldBegin(HOST_NAME_FIELD_DESC);
+ oprot.writeString(struct.hostName);
+ oprot.writeFieldEnd();
+ }
+ if (struct.queueName != null) {
+ oprot.writeFieldBegin(QUEUE_NAME_FIELD_DESC);
+ oprot.writeString(struct.queueName);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(QUEUE_UP_FIELD_DESC);
+ oprot.writeBool(struct.queueUp);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(RUNNING_JOBS_FIELD_DESC);
+ oprot.writeI32(struct.runningJobs);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(QUEUED_JOBS_FIELD_DESC);
+ oprot.writeI32(struct.queuedJobs);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(TIME_FIELD_DESC);
+ oprot.writeI64(struct.time);
+ oprot.writeFieldEnd();
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class QueueStatusModelTupleSchemeFactory implements SchemeFactory {
+ public QueueStatusModelTupleScheme getScheme() {
+ return new QueueStatusModelTupleScheme();
+ }
+ }
+
+ private static class QueueStatusModelTupleScheme extends TupleScheme<QueueStatusModel> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, QueueStatusModel struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ oprot.writeString(struct.hostName);
+ oprot.writeString(struct.queueName);
+ oprot.writeBool(struct.queueUp);
+ oprot.writeI32(struct.runningJobs);
+ oprot.writeI32(struct.queuedJobs);
+ oprot.writeI64(struct.time);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, QueueStatusModel struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.hostName = iprot.readString();
+ struct.setHostNameIsSet(true);
+ struct.queueName = iprot.readString();
+ struct.setQueueNameIsSet(true);
+ struct.queueUp = iprot.readBool();
+ struct.setQueueUpIsSet(true);
+ struct.runningJobs = iprot.readI32();
+ struct.setRunningJobsIsSet(true);
+ struct.queuedJobs = iprot.readI32();
+ struct.setQueuedJobsIsSet(true);
+ struct.time = iprot.readI64();
+ struct.setTimeIsSet(true);
+ }
+ }
+
+}
+