| /** |
| * 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 ComputeResourcePolicy implements org.apache.thrift.TBase<ComputeResourcePolicy, ComputeResourcePolicy._Fields>, java.io.Serializable, Cloneable, Comparable<ComputeResourcePolicy> { |
| private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ComputeResourcePolicy"); |
| |
| 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 ALLOWED_BATCH_QUEUES_FIELD_DESC = new org.apache.thrift.protocol.TField("allowedBatchQueues", org.apache.thrift.protocol.TType.LIST, (short)4); |
| |
| private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ComputeResourcePolicyStandardSchemeFactory(); |
| private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ComputeResourcePolicyTupleSchemeFactory(); |
| |
| 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.util.List<java.lang.String> allowedBatchQueues; // 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"), |
| ALLOWED_BATCH_QUEUES((short)4, "allowedBatchQueues"); |
| |
| 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: // ALLOWED_BATCH_QUEUES |
| return ALLOWED_BATCH_QUEUES; |
| 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 _Fields optionals[] = {_Fields.ALLOWED_BATCH_QUEUES}; |
| 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.ALLOWED_BATCH_QUEUES, new org.apache.thrift.meta_data.FieldMetaData("allowedBatchQueues", org.apache.thrift.TFieldRequirementType.OPTIONAL, |
| new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); |
| metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); |
| org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ComputeResourcePolicy.class, metaDataMap); |
| } |
| |
| public ComputeResourcePolicy() { |
| this.resourcePolicyId = "DO_NOT_SET_AT_CLIENTS"; |
| |
| this.groupResourceProfileId = "DO_NOT_SET_AT_CLIENTS"; |
| |
| } |
| |
| public ComputeResourcePolicy( |
| 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 ComputeResourcePolicy(ComputeResourcePolicy other) { |
| if (other.isSetResourcePolicyId()) { |
| this.resourcePolicyId = other.resourcePolicyId; |
| } |
| if (other.isSetComputeResourceId()) { |
| this.computeResourceId = other.computeResourceId; |
| } |
| if (other.isSetGroupResourceProfileId()) { |
| this.groupResourceProfileId = other.groupResourceProfileId; |
| } |
| if (other.isSetAllowedBatchQueues()) { |
| java.util.List<java.lang.String> __this__allowedBatchQueues = new java.util.ArrayList<java.lang.String>(other.allowedBatchQueues); |
| this.allowedBatchQueues = __this__allowedBatchQueues; |
| } |
| } |
| |
| @Override |
| public ComputeResourcePolicy deepCopy() { |
| return new ComputeResourcePolicy(this); |
| } |
| |
| @Override |
| public void clear() { |
| this.resourcePolicyId = "DO_NOT_SET_AT_CLIENTS"; |
| |
| this.computeResourceId = null; |
| this.groupResourceProfileId = "DO_NOT_SET_AT_CLIENTS"; |
| |
| this.allowedBatchQueues = null; |
| } |
| |
| @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; |
| } |
| } |
| |
| public int getAllowedBatchQueuesSize() { |
| return (this.allowedBatchQueues == null) ? 0 : this.allowedBatchQueues.size(); |
| } |
| |
| @org.apache.thrift.annotation.Nullable |
| public java.util.Iterator<java.lang.String> getAllowedBatchQueuesIterator() { |
| return (this.allowedBatchQueues == null) ? null : this.allowedBatchQueues.iterator(); |
| } |
| |
| public void addToAllowedBatchQueues(java.lang.String elem) { |
| if (this.allowedBatchQueues == null) { |
| this.allowedBatchQueues = new java.util.ArrayList<java.lang.String>(); |
| } |
| this.allowedBatchQueues.add(elem); |
| } |
| |
| @org.apache.thrift.annotation.Nullable |
| public java.util.List<java.lang.String> getAllowedBatchQueues() { |
| return this.allowedBatchQueues; |
| } |
| |
| public void setAllowedBatchQueues(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> allowedBatchQueues) { |
| this.allowedBatchQueues = allowedBatchQueues; |
| } |
| |
| public void unsetAllowedBatchQueues() { |
| this.allowedBatchQueues = null; |
| } |
| |
| /** Returns true if field allowedBatchQueues is set (has been assigned a value) and false otherwise */ |
| public boolean isSetAllowedBatchQueues() { |
| return this.allowedBatchQueues != null; |
| } |
| |
| public void setAllowedBatchQueuesIsSet(boolean value) { |
| if (!value) { |
| this.allowedBatchQueues = null; |
| } |
| } |
| |
| @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 ALLOWED_BATCH_QUEUES: |
| if (value == null) { |
| unsetAllowedBatchQueues(); |
| } else { |
| setAllowedBatchQueues((java.util.List<java.lang.String>)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 ALLOWED_BATCH_QUEUES: |
| return getAllowedBatchQueues(); |
| |
| } |
| 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 ALLOWED_BATCH_QUEUES: |
| return isSetAllowedBatchQueues(); |
| } |
| throw new java.lang.IllegalStateException(); |
| } |
| |
| @Override |
| public boolean equals(java.lang.Object that) { |
| if (that instanceof ComputeResourcePolicy) |
| return this.equals((ComputeResourcePolicy)that); |
| return false; |
| } |
| |
| public boolean equals(ComputeResourcePolicy 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_allowedBatchQueues = true && this.isSetAllowedBatchQueues(); |
| boolean that_present_allowedBatchQueues = true && that.isSetAllowedBatchQueues(); |
| if (this_present_allowedBatchQueues || that_present_allowedBatchQueues) { |
| if (!(this_present_allowedBatchQueues && that_present_allowedBatchQueues)) |
| return false; |
| if (!this.allowedBatchQueues.equals(that.allowedBatchQueues)) |
| 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 + ((isSetAllowedBatchQueues()) ? 131071 : 524287); |
| if (isSetAllowedBatchQueues()) |
| hashCode = hashCode * 8191 + allowedBatchQueues.hashCode(); |
| |
| return hashCode; |
| } |
| |
| @Override |
| public int compareTo(ComputeResourcePolicy 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(isSetAllowedBatchQueues(), other.isSetAllowedBatchQueues()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetAllowedBatchQueues()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.allowedBatchQueues, other.allowedBatchQueues); |
| 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("ComputeResourcePolicy("); |
| 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 (isSetAllowedBatchQueues()) { |
| if (!first) sb.append(", "); |
| sb.append("allowedBatchQueues:"); |
| if (this.allowedBatchQueues == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.allowedBatchQueues); |
| } |
| 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 { |
| 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 ComputeResourcePolicyStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| @Override |
| public ComputeResourcePolicyStandardScheme getScheme() { |
| return new ComputeResourcePolicyStandardScheme(); |
| } |
| } |
| |
| private static class ComputeResourcePolicyStandardScheme extends org.apache.thrift.scheme.StandardScheme<ComputeResourcePolicy> { |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol iprot, ComputeResourcePolicy 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: // ALLOWED_BATCH_QUEUES |
| if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { |
| { |
| org.apache.thrift.protocol.TList _list24 = iprot.readListBegin(); |
| struct.allowedBatchQueues = new java.util.ArrayList<java.lang.String>(_list24.size); |
| @org.apache.thrift.annotation.Nullable java.lang.String _elem25; |
| for (int _i26 = 0; _i26 < _list24.size; ++_i26) |
| { |
| _elem25 = iprot.readString(); |
| struct.allowedBatchQueues.add(_elem25); |
| } |
| iprot.readListEnd(); |
| } |
| struct.setAllowedBatchQueuesIsSet(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, ComputeResourcePolicy 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.allowedBatchQueues != null) { |
| if (struct.isSetAllowedBatchQueues()) { |
| oprot.writeFieldBegin(ALLOWED_BATCH_QUEUES_FIELD_DESC); |
| { |
| oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.allowedBatchQueues.size())); |
| for (java.lang.String _iter27 : struct.allowedBatchQueues) |
| { |
| oprot.writeString(_iter27); |
| } |
| oprot.writeListEnd(); |
| } |
| oprot.writeFieldEnd(); |
| } |
| } |
| oprot.writeFieldStop(); |
| oprot.writeStructEnd(); |
| } |
| |
| } |
| |
| private static class ComputeResourcePolicyTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| @Override |
| public ComputeResourcePolicyTupleScheme getScheme() { |
| return new ComputeResourcePolicyTupleScheme(); |
| } |
| } |
| |
| private static class ComputeResourcePolicyTupleScheme extends org.apache.thrift.scheme.TupleScheme<ComputeResourcePolicy> { |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol prot, ComputeResourcePolicy 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.isSetAllowedBatchQueues()) { |
| optionals.set(0); |
| } |
| oprot.writeBitSet(optionals, 1); |
| if (struct.isSetAllowedBatchQueues()) { |
| { |
| oprot.writeI32(struct.allowedBatchQueues.size()); |
| for (java.lang.String _iter28 : struct.allowedBatchQueues) |
| { |
| oprot.writeString(_iter28); |
| } |
| } |
| } |
| } |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol prot, ComputeResourcePolicy 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(1); |
| if (incoming.get(0)) { |
| { |
| org.apache.thrift.protocol.TList _list29 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); |
| struct.allowedBatchQueues = new java.util.ArrayList<java.lang.String>(_list29.size); |
| @org.apache.thrift.annotation.Nullable java.lang.String _elem30; |
| for (int _i31 = 0; _i31 < _list29.size; ++_i31) |
| { |
| _elem30 = iprot.readString(); |
| struct.allowedBatchQueues.add(_elem30); |
| } |
| } |
| struct.setAllowedBatchQueuesIsSet(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(); |
| } |
| } |
| |