| /** |
| * 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.18.1) |
| * |
| * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING |
| * @generated |
| */ |
| package org.apache.airavata.model.appcatalog.groupresourceprofile; |
| |
| @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) |
| @javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.18.1)") |
| public class BatchQueueResourcePolicy implements org.apache.thrift.TBase<BatchQueueResourcePolicy, BatchQueueResourcePolicy._Fields>, java.io.Serializable, Cloneable, Comparable<BatchQueueResourcePolicy> { |
| private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BatchQueueResourcePolicy"); |
| |
| private static final org.apache.thrift.protocol.TField RESOURCE_POLICY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("resourcePolicyId", org.apache.thrift.protocol.TType.STRING, (short)1); |
| private static final org.apache.thrift.protocol.TField COMPUTE_RESOURCE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("computeResourceId", org.apache.thrift.protocol.TType.STRING, (short)2); |
| private static final org.apache.thrift.protocol.TField GROUP_RESOURCE_PROFILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("groupResourceProfileId", org.apache.thrift.protocol.TType.STRING, (short)3); |
| private static final org.apache.thrift.protocol.TField QUEUENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("queuename", org.apache.thrift.protocol.TType.STRING, (short)4); |
| private static final org.apache.thrift.protocol.TField MAX_ALLOWED_NODES_FIELD_DESC = new org.apache.thrift.protocol.TField("maxAllowedNodes", org.apache.thrift.protocol.TType.I32, (short)5); |
| private static final org.apache.thrift.protocol.TField MAX_ALLOWED_CORES_FIELD_DESC = new org.apache.thrift.protocol.TField("maxAllowedCores", org.apache.thrift.protocol.TType.I32, (short)6); |
| private static final org.apache.thrift.protocol.TField MAX_ALLOWED_WALLTIME_FIELD_DESC = new org.apache.thrift.protocol.TField("maxAllowedWalltime", org.apache.thrift.protocol.TType.I32, (short)7); |
| |
| private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new BatchQueueResourcePolicyStandardSchemeFactory(); |
| private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new BatchQueueResourcePolicyTupleSchemeFactory(); |
| |
| private @org.apache.thrift.annotation.Nullable java.lang.String resourcePolicyId; // required |
| private @org.apache.thrift.annotation.Nullable java.lang.String computeResourceId; // required |
| private @org.apache.thrift.annotation.Nullable java.lang.String groupResourceProfileId; // required |
| private @org.apache.thrift.annotation.Nullable java.lang.String queuename; // optional |
| private int maxAllowedNodes; // optional |
| private int maxAllowedCores; // optional |
| private int maxAllowedWalltime; // optional |
| |
| /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ |
| public enum _Fields implements org.apache.thrift.TFieldIdEnum { |
| RESOURCE_POLICY_ID((short)1, "resourcePolicyId"), |
| COMPUTE_RESOURCE_ID((short)2, "computeResourceId"), |
| GROUP_RESOURCE_PROFILE_ID((short)3, "groupResourceProfileId"), |
| QUEUENAME((short)4, "queuename"), |
| MAX_ALLOWED_NODES((short)5, "maxAllowedNodes"), |
| MAX_ALLOWED_CORES((short)6, "maxAllowedCores"), |
| MAX_ALLOWED_WALLTIME((short)7, "maxAllowedWalltime"); |
| |
| private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); |
| |
| static { |
| for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { |
| byName.put(field.getFieldName(), field); |
| } |
| } |
| |
| /** |
| * Find the _Fields constant that matches fieldId, or null if its not found. |
| */ |
| @org.apache.thrift.annotation.Nullable |
| public static _Fields findByThriftId(int fieldId) { |
| switch(fieldId) { |
| case 1: // RESOURCE_POLICY_ID |
| return RESOURCE_POLICY_ID; |
| case 2: // COMPUTE_RESOURCE_ID |
| return COMPUTE_RESOURCE_ID; |
| case 3: // GROUP_RESOURCE_PROFILE_ID |
| return GROUP_RESOURCE_PROFILE_ID; |
| case 4: // QUEUENAME |
| return QUEUENAME; |
| case 5: // MAX_ALLOWED_NODES |
| return MAX_ALLOWED_NODES; |
| case 6: // MAX_ALLOWED_CORES |
| return MAX_ALLOWED_CORES; |
| case 7: // MAX_ALLOWED_WALLTIME |
| return MAX_ALLOWED_WALLTIME; |
| 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); |
| return fields; |
| } |
| |
| /** |
| * Find the _Fields constant that matches name, or null if its not found. |
| */ |
| @org.apache.thrift.annotation.Nullable |
| public static _Fields findByName(java.lang.String name) { |
| return byName.get(name); |
| } |
| |
| private final short _thriftId; |
| private final java.lang.String _fieldName; |
| |
| _Fields(short thriftId, java.lang.String fieldName) { |
| _thriftId = thriftId; |
| _fieldName = fieldName; |
| } |
| |
| @Override |
| public short getThriftFieldId() { |
| return _thriftId; |
| } |
| |
| @Override |
| public java.lang.String getFieldName() { |
| return _fieldName; |
| } |
| } |
| |
| // isset id assignments |
| private static final int __MAXALLOWEDNODES_ISSET_ID = 0; |
| private static final int __MAXALLOWEDCORES_ISSET_ID = 1; |
| private static final int __MAXALLOWEDWALLTIME_ISSET_ID = 2; |
| private byte __isset_bitfield = 0; |
| private static final _Fields optionals[] = {_Fields.QUEUENAME,_Fields.MAX_ALLOWED_NODES,_Fields.MAX_ALLOWED_CORES,_Fields.MAX_ALLOWED_WALLTIME}; |
| public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; |
| static { |
| java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); |
| tmpMap.put(_Fields.RESOURCE_POLICY_ID, new org.apache.thrift.meta_data.FieldMetaData("resourcePolicyId", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); |
| tmpMap.put(_Fields.COMPUTE_RESOURCE_ID, new org.apache.thrift.meta_data.FieldMetaData("computeResourceId", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); |
| tmpMap.put(_Fields.GROUP_RESOURCE_PROFILE_ID, new org.apache.thrift.meta_data.FieldMetaData("groupResourceProfileId", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); |
| tmpMap.put(_Fields.QUEUENAME, new org.apache.thrift.meta_data.FieldMetaData("queuename", org.apache.thrift.TFieldRequirementType.OPTIONAL, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); |
| tmpMap.put(_Fields.MAX_ALLOWED_NODES, new org.apache.thrift.meta_data.FieldMetaData("maxAllowedNodes", org.apache.thrift.TFieldRequirementType.OPTIONAL, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); |
| tmpMap.put(_Fields.MAX_ALLOWED_CORES, new org.apache.thrift.meta_data.FieldMetaData("maxAllowedCores", org.apache.thrift.TFieldRequirementType.OPTIONAL, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); |
| tmpMap.put(_Fields.MAX_ALLOWED_WALLTIME, new org.apache.thrift.meta_data.FieldMetaData("maxAllowedWalltime", org.apache.thrift.TFieldRequirementType.OPTIONAL, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); |
| metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); |
| org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BatchQueueResourcePolicy.class, metaDataMap); |
| } |
| |
| public BatchQueueResourcePolicy() { |
| this.resourcePolicyId = "DO_NOT_SET_AT_CLIENTS"; |
| |
| this.groupResourceProfileId = "DO_NOT_SET_AT_CLIENTS"; |
| |
| } |
| |
| public BatchQueueResourcePolicy( |
| java.lang.String resourcePolicyId, |
| java.lang.String computeResourceId, |
| java.lang.String groupResourceProfileId) |
| { |
| this(); |
| this.resourcePolicyId = resourcePolicyId; |
| this.computeResourceId = computeResourceId; |
| this.groupResourceProfileId = groupResourceProfileId; |
| } |
| |
| /** |
| * Performs a deep copy on <i>other</i>. |
| */ |
| public BatchQueueResourcePolicy(BatchQueueResourcePolicy other) { |
| __isset_bitfield = other.__isset_bitfield; |
| if (other.isSetResourcePolicyId()) { |
| this.resourcePolicyId = other.resourcePolicyId; |
| } |
| if (other.isSetComputeResourceId()) { |
| this.computeResourceId = other.computeResourceId; |
| } |
| if (other.isSetGroupResourceProfileId()) { |
| this.groupResourceProfileId = other.groupResourceProfileId; |
| } |
| if (other.isSetQueuename()) { |
| this.queuename = other.queuename; |
| } |
| this.maxAllowedNodes = other.maxAllowedNodes; |
| this.maxAllowedCores = other.maxAllowedCores; |
| this.maxAllowedWalltime = other.maxAllowedWalltime; |
| } |
| |
| @Override |
| public BatchQueueResourcePolicy deepCopy() { |
| return new BatchQueueResourcePolicy(this); |
| } |
| |
| @Override |
| public void clear() { |
| this.resourcePolicyId = "DO_NOT_SET_AT_CLIENTS"; |
| |
| this.computeResourceId = null; |
| this.groupResourceProfileId = "DO_NOT_SET_AT_CLIENTS"; |
| |
| this.queuename = null; |
| setMaxAllowedNodesIsSet(false); |
| this.maxAllowedNodes = 0; |
| setMaxAllowedCoresIsSet(false); |
| this.maxAllowedCores = 0; |
| setMaxAllowedWalltimeIsSet(false); |
| this.maxAllowedWalltime = 0; |
| } |
| |
| @org.apache.thrift.annotation.Nullable |
| public java.lang.String getResourcePolicyId() { |
| return this.resourcePolicyId; |
| } |
| |
| public void setResourcePolicyId(@org.apache.thrift.annotation.Nullable java.lang.String resourcePolicyId) { |
| this.resourcePolicyId = resourcePolicyId; |
| } |
| |
| public void unsetResourcePolicyId() { |
| this.resourcePolicyId = null; |
| } |
| |
| /** Returns true if field resourcePolicyId is set (has been assigned a value) and false otherwise */ |
| public boolean isSetResourcePolicyId() { |
| return this.resourcePolicyId != null; |
| } |
| |
| public void setResourcePolicyIdIsSet(boolean value) { |
| if (!value) { |
| this.resourcePolicyId = null; |
| } |
| } |
| |
| @org.apache.thrift.annotation.Nullable |
| public java.lang.String getComputeResourceId() { |
| return this.computeResourceId; |
| } |
| |
| public void setComputeResourceId(@org.apache.thrift.annotation.Nullable java.lang.String computeResourceId) { |
| this.computeResourceId = computeResourceId; |
| } |
| |
| public void unsetComputeResourceId() { |
| this.computeResourceId = null; |
| } |
| |
| /** Returns true if field computeResourceId is set (has been assigned a value) and false otherwise */ |
| public boolean isSetComputeResourceId() { |
| return this.computeResourceId != null; |
| } |
| |
| public void setComputeResourceIdIsSet(boolean value) { |
| if (!value) { |
| this.computeResourceId = null; |
| } |
| } |
| |
| @org.apache.thrift.annotation.Nullable |
| public java.lang.String getGroupResourceProfileId() { |
| return this.groupResourceProfileId; |
| } |
| |
| public void setGroupResourceProfileId(@org.apache.thrift.annotation.Nullable java.lang.String groupResourceProfileId) { |
| this.groupResourceProfileId = groupResourceProfileId; |
| } |
| |
| public void unsetGroupResourceProfileId() { |
| this.groupResourceProfileId = null; |
| } |
| |
| /** Returns true if field groupResourceProfileId is set (has been assigned a value) and false otherwise */ |
| public boolean isSetGroupResourceProfileId() { |
| return this.groupResourceProfileId != null; |
| } |
| |
| public void setGroupResourceProfileIdIsSet(boolean value) { |
| if (!value) { |
| this.groupResourceProfileId = null; |
| } |
| } |
| |
| @org.apache.thrift.annotation.Nullable |
| public java.lang.String getQueuename() { |
| return this.queuename; |
| } |
| |
| public void setQueuename(@org.apache.thrift.annotation.Nullable java.lang.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 int getMaxAllowedNodes() { |
| return this.maxAllowedNodes; |
| } |
| |
| public void setMaxAllowedNodes(int maxAllowedNodes) { |
| this.maxAllowedNodes = maxAllowedNodes; |
| setMaxAllowedNodesIsSet(true); |
| } |
| |
| public void unsetMaxAllowedNodes() { |
| __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAXALLOWEDNODES_ISSET_ID); |
| } |
| |
| /** Returns true if field maxAllowedNodes is set (has been assigned a value) and false otherwise */ |
| public boolean isSetMaxAllowedNodes() { |
| return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAXALLOWEDNODES_ISSET_ID); |
| } |
| |
| public void setMaxAllowedNodesIsSet(boolean value) { |
| __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAXALLOWEDNODES_ISSET_ID, value); |
| } |
| |
| public int getMaxAllowedCores() { |
| return this.maxAllowedCores; |
| } |
| |
| public void setMaxAllowedCores(int maxAllowedCores) { |
| this.maxAllowedCores = maxAllowedCores; |
| setMaxAllowedCoresIsSet(true); |
| } |
| |
| public void unsetMaxAllowedCores() { |
| __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAXALLOWEDCORES_ISSET_ID); |
| } |
| |
| /** Returns true if field maxAllowedCores is set (has been assigned a value) and false otherwise */ |
| public boolean isSetMaxAllowedCores() { |
| return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAXALLOWEDCORES_ISSET_ID); |
| } |
| |
| public void setMaxAllowedCoresIsSet(boolean value) { |
| __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAXALLOWEDCORES_ISSET_ID, value); |
| } |
| |
| public int getMaxAllowedWalltime() { |
| return this.maxAllowedWalltime; |
| } |
| |
| public void setMaxAllowedWalltime(int maxAllowedWalltime) { |
| this.maxAllowedWalltime = maxAllowedWalltime; |
| setMaxAllowedWalltimeIsSet(true); |
| } |
| |
| public void unsetMaxAllowedWalltime() { |
| __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAXALLOWEDWALLTIME_ISSET_ID); |
| } |
| |
| /** Returns true if field maxAllowedWalltime is set (has been assigned a value) and false otherwise */ |
| public boolean isSetMaxAllowedWalltime() { |
| return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAXALLOWEDWALLTIME_ISSET_ID); |
| } |
| |
| public void setMaxAllowedWalltimeIsSet(boolean value) { |
| __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAXALLOWEDWALLTIME_ISSET_ID, value); |
| } |
| |
| @Override |
| public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { |
| switch (field) { |
| case RESOURCE_POLICY_ID: |
| if (value == null) { |
| unsetResourcePolicyId(); |
| } else { |
| setResourcePolicyId((java.lang.String)value); |
| } |
| break; |
| |
| case COMPUTE_RESOURCE_ID: |
| if (value == null) { |
| unsetComputeResourceId(); |
| } else { |
| setComputeResourceId((java.lang.String)value); |
| } |
| break; |
| |
| case GROUP_RESOURCE_PROFILE_ID: |
| if (value == null) { |
| unsetGroupResourceProfileId(); |
| } else { |
| setGroupResourceProfileId((java.lang.String)value); |
| } |
| break; |
| |
| case QUEUENAME: |
| if (value == null) { |
| unsetQueuename(); |
| } else { |
| setQueuename((java.lang.String)value); |
| } |
| break; |
| |
| case MAX_ALLOWED_NODES: |
| if (value == null) { |
| unsetMaxAllowedNodes(); |
| } else { |
| setMaxAllowedNodes((java.lang.Integer)value); |
| } |
| break; |
| |
| case MAX_ALLOWED_CORES: |
| if (value == null) { |
| unsetMaxAllowedCores(); |
| } else { |
| setMaxAllowedCores((java.lang.Integer)value); |
| } |
| break; |
| |
| case MAX_ALLOWED_WALLTIME: |
| if (value == null) { |
| unsetMaxAllowedWalltime(); |
| } else { |
| setMaxAllowedWalltime((java.lang.Integer)value); |
| } |
| break; |
| |
| } |
| } |
| |
| @org.apache.thrift.annotation.Nullable |
| @Override |
| public java.lang.Object getFieldValue(_Fields field) { |
| switch (field) { |
| case RESOURCE_POLICY_ID: |
| return getResourcePolicyId(); |
| |
| case COMPUTE_RESOURCE_ID: |
| return getComputeResourceId(); |
| |
| case GROUP_RESOURCE_PROFILE_ID: |
| return getGroupResourceProfileId(); |
| |
| case QUEUENAME: |
| return getQueuename(); |
| |
| case MAX_ALLOWED_NODES: |
| return getMaxAllowedNodes(); |
| |
| case MAX_ALLOWED_CORES: |
| return getMaxAllowedCores(); |
| |
| case MAX_ALLOWED_WALLTIME: |
| return getMaxAllowedWalltime(); |
| |
| } |
| throw new java.lang.IllegalStateException(); |
| } |
| |
| /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ |
| @Override |
| public boolean isSet(_Fields field) { |
| if (field == null) { |
| throw new java.lang.IllegalArgumentException(); |
| } |
| |
| switch (field) { |
| case RESOURCE_POLICY_ID: |
| return isSetResourcePolicyId(); |
| case COMPUTE_RESOURCE_ID: |
| return isSetComputeResourceId(); |
| case GROUP_RESOURCE_PROFILE_ID: |
| return isSetGroupResourceProfileId(); |
| case QUEUENAME: |
| return isSetQueuename(); |
| case MAX_ALLOWED_NODES: |
| return isSetMaxAllowedNodes(); |
| case MAX_ALLOWED_CORES: |
| return isSetMaxAllowedCores(); |
| case MAX_ALLOWED_WALLTIME: |
| return isSetMaxAllowedWalltime(); |
| } |
| throw new java.lang.IllegalStateException(); |
| } |
| |
| @Override |
| public boolean equals(java.lang.Object that) { |
| if (that instanceof BatchQueueResourcePolicy) |
| return this.equals((BatchQueueResourcePolicy)that); |
| return false; |
| } |
| |
| public boolean equals(BatchQueueResourcePolicy that) { |
| if (that == null) |
| return false; |
| if (this == that) |
| return true; |
| |
| boolean this_present_resourcePolicyId = true && this.isSetResourcePolicyId(); |
| boolean that_present_resourcePolicyId = true && that.isSetResourcePolicyId(); |
| if (this_present_resourcePolicyId || that_present_resourcePolicyId) { |
| if (!(this_present_resourcePolicyId && that_present_resourcePolicyId)) |
| return false; |
| if (!this.resourcePolicyId.equals(that.resourcePolicyId)) |
| return false; |
| } |
| |
| boolean this_present_computeResourceId = true && this.isSetComputeResourceId(); |
| boolean that_present_computeResourceId = true && that.isSetComputeResourceId(); |
| if (this_present_computeResourceId || that_present_computeResourceId) { |
| if (!(this_present_computeResourceId && that_present_computeResourceId)) |
| return false; |
| if (!this.computeResourceId.equals(that.computeResourceId)) |
| return false; |
| } |
| |
| boolean this_present_groupResourceProfileId = true && this.isSetGroupResourceProfileId(); |
| boolean that_present_groupResourceProfileId = true && that.isSetGroupResourceProfileId(); |
| if (this_present_groupResourceProfileId || that_present_groupResourceProfileId) { |
| if (!(this_present_groupResourceProfileId && that_present_groupResourceProfileId)) |
| return false; |
| if (!this.groupResourceProfileId.equals(that.groupResourceProfileId)) |
| 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_maxAllowedNodes = true && this.isSetMaxAllowedNodes(); |
| boolean that_present_maxAllowedNodes = true && that.isSetMaxAllowedNodes(); |
| if (this_present_maxAllowedNodes || that_present_maxAllowedNodes) { |
| if (!(this_present_maxAllowedNodes && that_present_maxAllowedNodes)) |
| return false; |
| if (this.maxAllowedNodes != that.maxAllowedNodes) |
| return false; |
| } |
| |
| boolean this_present_maxAllowedCores = true && this.isSetMaxAllowedCores(); |
| boolean that_present_maxAllowedCores = true && that.isSetMaxAllowedCores(); |
| if (this_present_maxAllowedCores || that_present_maxAllowedCores) { |
| if (!(this_present_maxAllowedCores && that_present_maxAllowedCores)) |
| return false; |
| if (this.maxAllowedCores != that.maxAllowedCores) |
| return false; |
| } |
| |
| boolean this_present_maxAllowedWalltime = true && this.isSetMaxAllowedWalltime(); |
| boolean that_present_maxAllowedWalltime = true && that.isSetMaxAllowedWalltime(); |
| if (this_present_maxAllowedWalltime || that_present_maxAllowedWalltime) { |
| if (!(this_present_maxAllowedWalltime && that_present_maxAllowedWalltime)) |
| return false; |
| if (this.maxAllowedWalltime != that.maxAllowedWalltime) |
| return false; |
| } |
| |
| return true; |
| } |
| |
| @Override |
| public int hashCode() { |
| int hashCode = 1; |
| |
| hashCode = hashCode * 8191 + ((isSetResourcePolicyId()) ? 131071 : 524287); |
| if (isSetResourcePolicyId()) |
| hashCode = hashCode * 8191 + resourcePolicyId.hashCode(); |
| |
| hashCode = hashCode * 8191 + ((isSetComputeResourceId()) ? 131071 : 524287); |
| if (isSetComputeResourceId()) |
| hashCode = hashCode * 8191 + computeResourceId.hashCode(); |
| |
| hashCode = hashCode * 8191 + ((isSetGroupResourceProfileId()) ? 131071 : 524287); |
| if (isSetGroupResourceProfileId()) |
| hashCode = hashCode * 8191 + groupResourceProfileId.hashCode(); |
| |
| hashCode = hashCode * 8191 + ((isSetQueuename()) ? 131071 : 524287); |
| if (isSetQueuename()) |
| hashCode = hashCode * 8191 + queuename.hashCode(); |
| |
| hashCode = hashCode * 8191 + ((isSetMaxAllowedNodes()) ? 131071 : 524287); |
| if (isSetMaxAllowedNodes()) |
| hashCode = hashCode * 8191 + maxAllowedNodes; |
| |
| hashCode = hashCode * 8191 + ((isSetMaxAllowedCores()) ? 131071 : 524287); |
| if (isSetMaxAllowedCores()) |
| hashCode = hashCode * 8191 + maxAllowedCores; |
| |
| hashCode = hashCode * 8191 + ((isSetMaxAllowedWalltime()) ? 131071 : 524287); |
| if (isSetMaxAllowedWalltime()) |
| hashCode = hashCode * 8191 + maxAllowedWalltime; |
| |
| return hashCode; |
| } |
| |
| @Override |
| public int compareTo(BatchQueueResourcePolicy other) { |
| if (!getClass().equals(other.getClass())) { |
| return getClass().getName().compareTo(other.getClass().getName()); |
| } |
| |
| int lastComparison = 0; |
| |
| lastComparison = java.lang.Boolean.compare(isSetResourcePolicyId(), other.isSetResourcePolicyId()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetResourcePolicyId()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resourcePolicyId, other.resourcePolicyId); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| lastComparison = java.lang.Boolean.compare(isSetComputeResourceId(), other.isSetComputeResourceId()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetComputeResourceId()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.computeResourceId, other.computeResourceId); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| lastComparison = java.lang.Boolean.compare(isSetGroupResourceProfileId(), other.isSetGroupResourceProfileId()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetGroupResourceProfileId()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.groupResourceProfileId, other.groupResourceProfileId); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| lastComparison = java.lang.Boolean.compare(isSetQueuename(), 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 = java.lang.Boolean.compare(isSetMaxAllowedNodes(), other.isSetMaxAllowedNodes()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetMaxAllowedNodes()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxAllowedNodes, other.maxAllowedNodes); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| lastComparison = java.lang.Boolean.compare(isSetMaxAllowedCores(), other.isSetMaxAllowedCores()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetMaxAllowedCores()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxAllowedCores, other.maxAllowedCores); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| lastComparison = java.lang.Boolean.compare(isSetMaxAllowedWalltime(), other.isSetMaxAllowedWalltime()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetMaxAllowedWalltime()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxAllowedWalltime, other.maxAllowedWalltime); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| return 0; |
| } |
| |
| @org.apache.thrift.annotation.Nullable |
| @Override |
| public _Fields fieldForId(int fieldId) { |
| return _Fields.findByThriftId(fieldId); |
| } |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { |
| scheme(iprot).read(iprot, this); |
| } |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { |
| scheme(oprot).write(oprot, this); |
| } |
| |
| @Override |
| public java.lang.String toString() { |
| java.lang.StringBuilder sb = new java.lang.StringBuilder("BatchQueueResourcePolicy("); |
| boolean first = true; |
| |
| sb.append("resourcePolicyId:"); |
| if (this.resourcePolicyId == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.resourcePolicyId); |
| } |
| first = false; |
| if (!first) sb.append(", "); |
| sb.append("computeResourceId:"); |
| if (this.computeResourceId == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.computeResourceId); |
| } |
| first = false; |
| if (!first) sb.append(", "); |
| sb.append("groupResourceProfileId:"); |
| if (this.groupResourceProfileId == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.groupResourceProfileId); |
| } |
| first = false; |
| if (isSetQueuename()) { |
| if (!first) sb.append(", "); |
| sb.append("queuename:"); |
| if (this.queuename == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.queuename); |
| } |
| first = false; |
| } |
| if (isSetMaxAllowedNodes()) { |
| if (!first) sb.append(", "); |
| sb.append("maxAllowedNodes:"); |
| sb.append(this.maxAllowedNodes); |
| first = false; |
| } |
| if (isSetMaxAllowedCores()) { |
| if (!first) sb.append(", "); |
| sb.append("maxAllowedCores:"); |
| sb.append(this.maxAllowedCores); |
| first = false; |
| } |
| if (isSetMaxAllowedWalltime()) { |
| if (!first) sb.append(", "); |
| sb.append("maxAllowedWalltime:"); |
| sb.append(this.maxAllowedWalltime); |
| first = false; |
| } |
| sb.append(")"); |
| return sb.toString(); |
| } |
| |
| public void validate() throws org.apache.thrift.TException { |
| // check for required fields |
| if (!isSetResourcePolicyId()) { |
| throw new org.apache.thrift.protocol.TProtocolException("Required field 'resourcePolicyId' is unset! Struct:" + toString()); |
| } |
| |
| if (!isSetComputeResourceId()) { |
| throw new org.apache.thrift.protocol.TProtocolException("Required field 'computeResourceId' is unset! Struct:" + toString()); |
| } |
| |
| if (!isSetGroupResourceProfileId()) { |
| throw new org.apache.thrift.protocol.TProtocolException("Required field 'groupResourceProfileId' 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, java.lang.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 BatchQueueResourcePolicyStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| @Override |
| public BatchQueueResourcePolicyStandardScheme getScheme() { |
| return new BatchQueueResourcePolicyStandardScheme(); |
| } |
| } |
| |
| private static class BatchQueueResourcePolicyStandardScheme extends org.apache.thrift.scheme.StandardScheme<BatchQueueResourcePolicy> { |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol iprot, BatchQueueResourcePolicy 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: // RESOURCE_POLICY_ID |
| if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { |
| struct.resourcePolicyId = iprot.readString(); |
| struct.setResourcePolicyIdIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| case 2: // COMPUTE_RESOURCE_ID |
| if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { |
| struct.computeResourceId = iprot.readString(); |
| struct.setComputeResourceIdIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| case 3: // GROUP_RESOURCE_PROFILE_ID |
| if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { |
| struct.groupResourceProfileId = iprot.readString(); |
| struct.setGroupResourceProfileIdIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| case 4: // QUEUENAME |
| 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 5: // MAX_ALLOWED_NODES |
| if (schemeField.type == org.apache.thrift.protocol.TType.I32) { |
| struct.maxAllowedNodes = iprot.readI32(); |
| struct.setMaxAllowedNodesIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| case 6: // MAX_ALLOWED_CORES |
| if (schemeField.type == org.apache.thrift.protocol.TType.I32) { |
| struct.maxAllowedCores = iprot.readI32(); |
| struct.setMaxAllowedCoresIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| case 7: // MAX_ALLOWED_WALLTIME |
| if (schemeField.type == org.apache.thrift.protocol.TType.I32) { |
| struct.maxAllowedWalltime = iprot.readI32(); |
| struct.setMaxAllowedWalltimeIsSet(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(); |
| } |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol oprot, BatchQueueResourcePolicy struct) throws org.apache.thrift.TException { |
| struct.validate(); |
| |
| oprot.writeStructBegin(STRUCT_DESC); |
| if (struct.resourcePolicyId != null) { |
| oprot.writeFieldBegin(RESOURCE_POLICY_ID_FIELD_DESC); |
| oprot.writeString(struct.resourcePolicyId); |
| oprot.writeFieldEnd(); |
| } |
| if (struct.computeResourceId != null) { |
| oprot.writeFieldBegin(COMPUTE_RESOURCE_ID_FIELD_DESC); |
| oprot.writeString(struct.computeResourceId); |
| oprot.writeFieldEnd(); |
| } |
| if (struct.groupResourceProfileId != null) { |
| oprot.writeFieldBegin(GROUP_RESOURCE_PROFILE_ID_FIELD_DESC); |
| oprot.writeString(struct.groupResourceProfileId); |
| oprot.writeFieldEnd(); |
| } |
| if (struct.queuename != null) { |
| if (struct.isSetQueuename()) { |
| oprot.writeFieldBegin(QUEUENAME_FIELD_DESC); |
| oprot.writeString(struct.queuename); |
| oprot.writeFieldEnd(); |
| } |
| } |
| if (struct.isSetMaxAllowedNodes()) { |
| oprot.writeFieldBegin(MAX_ALLOWED_NODES_FIELD_DESC); |
| oprot.writeI32(struct.maxAllowedNodes); |
| oprot.writeFieldEnd(); |
| } |
| if (struct.isSetMaxAllowedCores()) { |
| oprot.writeFieldBegin(MAX_ALLOWED_CORES_FIELD_DESC); |
| oprot.writeI32(struct.maxAllowedCores); |
| oprot.writeFieldEnd(); |
| } |
| if (struct.isSetMaxAllowedWalltime()) { |
| oprot.writeFieldBegin(MAX_ALLOWED_WALLTIME_FIELD_DESC); |
| oprot.writeI32(struct.maxAllowedWalltime); |
| oprot.writeFieldEnd(); |
| } |
| oprot.writeFieldStop(); |
| oprot.writeStructEnd(); |
| } |
| |
| } |
| |
| private static class BatchQueueResourcePolicyTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| @Override |
| public BatchQueueResourcePolicyTupleScheme getScheme() { |
| return new BatchQueueResourcePolicyTupleScheme(); |
| } |
| } |
| |
| private static class BatchQueueResourcePolicyTupleScheme extends org.apache.thrift.scheme.TupleScheme<BatchQueueResourcePolicy> { |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol prot, BatchQueueResourcePolicy struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| oprot.writeString(struct.resourcePolicyId); |
| oprot.writeString(struct.computeResourceId); |
| oprot.writeString(struct.groupResourceProfileId); |
| java.util.BitSet optionals = new java.util.BitSet(); |
| if (struct.isSetQueuename()) { |
| optionals.set(0); |
| } |
| if (struct.isSetMaxAllowedNodes()) { |
| optionals.set(1); |
| } |
| if (struct.isSetMaxAllowedCores()) { |
| optionals.set(2); |
| } |
| if (struct.isSetMaxAllowedWalltime()) { |
| optionals.set(3); |
| } |
| oprot.writeBitSet(optionals, 4); |
| if (struct.isSetQueuename()) { |
| oprot.writeString(struct.queuename); |
| } |
| if (struct.isSetMaxAllowedNodes()) { |
| oprot.writeI32(struct.maxAllowedNodes); |
| } |
| if (struct.isSetMaxAllowedCores()) { |
| oprot.writeI32(struct.maxAllowedCores); |
| } |
| if (struct.isSetMaxAllowedWalltime()) { |
| oprot.writeI32(struct.maxAllowedWalltime); |
| } |
| } |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol prot, BatchQueueResourcePolicy struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| struct.resourcePolicyId = iprot.readString(); |
| struct.setResourcePolicyIdIsSet(true); |
| struct.computeResourceId = iprot.readString(); |
| struct.setComputeResourceIdIsSet(true); |
| struct.groupResourceProfileId = iprot.readString(); |
| struct.setGroupResourceProfileIdIsSet(true); |
| java.util.BitSet incoming = iprot.readBitSet(4); |
| if (incoming.get(0)) { |
| struct.queuename = iprot.readString(); |
| struct.setQueuenameIsSet(true); |
| } |
| if (incoming.get(1)) { |
| struct.maxAllowedNodes = iprot.readI32(); |
| struct.setMaxAllowedNodesIsSet(true); |
| } |
| if (incoming.get(2)) { |
| struct.maxAllowedCores = iprot.readI32(); |
| struct.setMaxAllowedCoresIsSet(true); |
| } |
| if (incoming.get(3)) { |
| struct.maxAllowedWalltime = iprot.readI32(); |
| struct.setMaxAllowedWalltimeIsSet(true); |
| } |
| } |
| } |
| |
| private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { |
| return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); |
| } |
| } |
| |