http://git-wip-us.apache.org/repos/asf/airavata/blob/77d4925d/modules/thrift/interpreter-service/src/main/java/org/apache/airavata/experiment/execution/HPCSettings.java ---------------------------------------------------------------------- diff --git a/modules/thrift/interpreter-service/src/main/java/org/apache/airavata/experiment/execution/HPCSettings.java b/modules/thrift/interpreter-service/src/main/java/org/apache/airavata/experiment/execution/HPCSettings.java deleted file mode 100644 index dfb293f..0000000 --- a/modules/thrift/interpreter-service/src/main/java/org/apache/airavata/experiment/execution/HPCSettings.java +++ /dev/null @@ -1,798 +0,0 @@ -/* - * - * 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.1) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.airavata.experiment.execution; - -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class HPCSettings implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HPCSettings"); - - private static final org.apache.thrift.protocol.TField JOB_MANAGER_FIELD_DESC = new org.apache.thrift.protocol.TField("jobManager", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField CPU_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("cpuCount", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField NODE_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("nodeCount", org.apache.thrift.protocol.TType.I32, (short)3); - 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)4); - private static final org.apache.thrift.protocol.TField MAX_WALLTIME_FIELD_DESC = new org.apache.thrift.protocol.TField("maxWalltime", org.apache.thrift.protocol.TType.I32, (short)5); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new HPCSettingsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new HPCSettingsTupleSchemeFactory()); - } - - public String jobManager; // optional - public int cpuCount; // optional - public int nodeCount; // optional - public String queueName; // optional - public int maxWalltime; // 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 { - JOB_MANAGER((short)1, "jobManager"), - CPU_COUNT((short)2, "cpuCount"), - NODE_COUNT((short)3, "nodeCount"), - QUEUE_NAME((short)4, "queueName"), - MAX_WALLTIME((short)5, "maxWalltime"); - - private static final Map byName = new HashMap(); - - 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: // JOB_MANAGER - return JOB_MANAGER; - case 2: // CPU_COUNT - return CPU_COUNT; - case 3: // NODE_COUNT - return NODE_COUNT; - case 4: // QUEUE_NAME - return QUEUE_NAME; - case 5: // MAX_WALLTIME - return MAX_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 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 __CPUCOUNT_ISSET_ID = 0; - private static final int __NODECOUNT_ISSET_ID = 1; - private static final int __MAXWALLTIME_ISSET_ID = 2; - private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.JOB_MANAGER,_Fields.CPU_COUNT,_Fields.NODE_COUNT,_Fields.QUEUE_NAME,_Fields.MAX_WALLTIME}; - 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.JOB_MANAGER, new org.apache.thrift.meta_data.FieldMetaData("jobManager", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.CPU_COUNT, new org.apache.thrift.meta_data.FieldMetaData("cpuCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.NODE_COUNT, new org.apache.thrift.meta_data.FieldMetaData("nodeCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.QUEUE_NAME, 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_WALLTIME, new org.apache.thrift.meta_data.FieldMetaData("maxWalltime", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HPCSettings.class, metaDataMap); - } - - public HPCSettings() { - } - - /** - * Performs a deep copy on other. - */ - public HPCSettings(HPCSettings other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetJobManager()) { - this.jobManager = other.jobManager; - } - this.cpuCount = other.cpuCount; - this.nodeCount = other.nodeCount; - if (other.isSetQueueName()) { - this.queueName = other.queueName; - } - this.maxWalltime = other.maxWalltime; - } - - public HPCSettings deepCopy() { - return new HPCSettings(this); - } - - @Override - public void clear() { - this.jobManager = null; - setCpuCountIsSet(false); - this.cpuCount = 0; - setNodeCountIsSet(false); - this.nodeCount = 0; - this.queueName = null; - setMaxWalltimeIsSet(false); - this.maxWalltime = 0; - } - - public String getJobManager() { - return this.jobManager; - } - - public HPCSettings setJobManager(String jobManager) { - this.jobManager = jobManager; - return this; - } - - public void unsetJobManager() { - this.jobManager = null; - } - - /** Returns true if field jobManager is set (has been assigned a value) and false otherwise */ - public boolean isSetJobManager() { - return this.jobManager != null; - } - - public void setJobManagerIsSet(boolean value) { - if (!value) { - this.jobManager = null; - } - } - - public int getCpuCount() { - return this.cpuCount; - } - - public HPCSettings setCpuCount(int cpuCount) { - this.cpuCount = cpuCount; - setCpuCountIsSet(true); - return this; - } - - public void unsetCpuCount() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CPUCOUNT_ISSET_ID); - } - - /** Returns true if field cpuCount is set (has been assigned a value) and false otherwise */ - public boolean isSetCpuCount() { - return EncodingUtils.testBit(__isset_bitfield, __CPUCOUNT_ISSET_ID); - } - - public void setCpuCountIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CPUCOUNT_ISSET_ID, value); - } - - public int getNodeCount() { - return this.nodeCount; - } - - public HPCSettings setNodeCount(int nodeCount) { - this.nodeCount = nodeCount; - setNodeCountIsSet(true); - return this; - } - - public void unsetNodeCount() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NODECOUNT_ISSET_ID); - } - - /** Returns true if field nodeCount is set (has been assigned a value) and false otherwise */ - public boolean isSetNodeCount() { - return EncodingUtils.testBit(__isset_bitfield, __NODECOUNT_ISSET_ID); - } - - public void setNodeCountIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NODECOUNT_ISSET_ID, value); - } - - public String getQueueName() { - return this.queueName; - } - - public HPCSettings setQueueName(String queueName) { - this.queueName = queueName; - return this; - } - - 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 getMaxWalltime() { - return this.maxWalltime; - } - - public HPCSettings setMaxWalltime(int maxWalltime) { - this.maxWalltime = maxWalltime; - setMaxWalltimeIsSet(true); - return this; - } - - public void unsetMaxWalltime() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXWALLTIME_ISSET_ID); - } - - /** Returns true if field maxWalltime is set (has been assigned a value) and false otherwise */ - public boolean isSetMaxWalltime() { - return EncodingUtils.testBit(__isset_bitfield, __MAXWALLTIME_ISSET_ID); - } - - public void setMaxWalltimeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXWALLTIME_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case JOB_MANAGER: - if (value == null) { - unsetJobManager(); - } else { - setJobManager((String)value); - } - break; - - case CPU_COUNT: - if (value == null) { - unsetCpuCount(); - } else { - setCpuCount((Integer)value); - } - break; - - case NODE_COUNT: - if (value == null) { - unsetNodeCount(); - } else { - setNodeCount((Integer)value); - } - break; - - case QUEUE_NAME: - if (value == null) { - unsetQueueName(); - } else { - setQueueName((String)value); - } - break; - - case MAX_WALLTIME: - if (value == null) { - unsetMaxWalltime(); - } else { - setMaxWalltime((Integer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case JOB_MANAGER: - return getJobManager(); - - case CPU_COUNT: - return Integer.valueOf(getCpuCount()); - - case NODE_COUNT: - return Integer.valueOf(getNodeCount()); - - case QUEUE_NAME: - return getQueueName(); - - case MAX_WALLTIME: - return Integer.valueOf(getMaxWalltime()); - - } - 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 JOB_MANAGER: - return isSetJobManager(); - case CPU_COUNT: - return isSetCpuCount(); - case NODE_COUNT: - return isSetNodeCount(); - case QUEUE_NAME: - return isSetQueueName(); - case MAX_WALLTIME: - return isSetMaxWalltime(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof HPCSettings) - return this.equals((HPCSettings)that); - return false; - } - - public boolean equals(HPCSettings that) { - if (that == null) - return false; - - boolean this_present_jobManager = true && this.isSetJobManager(); - boolean that_present_jobManager = true && that.isSetJobManager(); - if (this_present_jobManager || that_present_jobManager) { - if (!(this_present_jobManager && that_present_jobManager)) - return false; - if (!this.jobManager.equals(that.jobManager)) - return false; - } - - boolean this_present_cpuCount = true && this.isSetCpuCount(); - boolean that_present_cpuCount = true && that.isSetCpuCount(); - if (this_present_cpuCount || that_present_cpuCount) { - if (!(this_present_cpuCount && that_present_cpuCount)) - return false; - if (this.cpuCount != that.cpuCount) - return false; - } - - boolean this_present_nodeCount = true && this.isSetNodeCount(); - boolean that_present_nodeCount = true && that.isSetNodeCount(); - if (this_present_nodeCount || that_present_nodeCount) { - if (!(this_present_nodeCount && that_present_nodeCount)) - return false; - if (this.nodeCount != that.nodeCount) - 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_maxWalltime = true && this.isSetMaxWalltime(); - boolean that_present_maxWalltime = true && that.isSetMaxWalltime(); - if (this_present_maxWalltime || that_present_maxWalltime) { - if (!(this_present_maxWalltime && that_present_maxWalltime)) - return false; - if (this.maxWalltime != that.maxWalltime) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(HPCSettings other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetJobManager()).compareTo(other.isSetJobManager()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetJobManager()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jobManager, other.jobManager); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetCpuCount()).compareTo(other.isSetCpuCount()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCpuCount()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cpuCount, other.cpuCount); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNodeCount()).compareTo(other.isSetNodeCount()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNodeCount()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nodeCount, other.nodeCount); - 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(isSetMaxWalltime()).compareTo(other.isSetMaxWalltime()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMaxWalltime()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxWalltime, other.maxWalltime); - 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("HPCSettings("); - boolean first = true; - - if (isSetJobManager()) { - sb.append("jobManager:"); - if (this.jobManager == null) { - sb.append("null"); - } else { - sb.append(this.jobManager); - } - first = false; - } - if (isSetCpuCount()) { - if (!first) sb.append(", "); - sb.append("cpuCount:"); - sb.append(this.cpuCount); - first = false; - } - if (isSetNodeCount()) { - if (!first) sb.append(", "); - sb.append("nodeCount:"); - sb.append(this.nodeCount); - 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 (isSetMaxWalltime()) { - if (!first) sb.append(", "); - sb.append("maxWalltime:"); - sb.append(this.maxWalltime); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // 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 HPCSettingsStandardSchemeFactory implements SchemeFactory { - public HPCSettingsStandardScheme getScheme() { - return new HPCSettingsStandardScheme(); - } - } - - private static class HPCSettingsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, HPCSettings 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: // JOB_MANAGER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.jobManager = iprot.readString(); - struct.setJobManagerIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // CPU_COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.cpuCount = iprot.readI32(); - struct.setCpuCountIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // NODE_COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.nodeCount = iprot.readI32(); - struct.setNodeCountIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // 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 5: // MAX_WALLTIME - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.maxWalltime = iprot.readI32(); - struct.setMaxWalltimeIsSet(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(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, HPCSettings struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.jobManager != null) { - if (struct.isSetJobManager()) { - oprot.writeFieldBegin(JOB_MANAGER_FIELD_DESC); - oprot.writeString(struct.jobManager); - oprot.writeFieldEnd(); - } - } - if (struct.isSetCpuCount()) { - oprot.writeFieldBegin(CPU_COUNT_FIELD_DESC); - oprot.writeI32(struct.cpuCount); - oprot.writeFieldEnd(); - } - if (struct.isSetNodeCount()) { - oprot.writeFieldBegin(NODE_COUNT_FIELD_DESC); - oprot.writeI32(struct.nodeCount); - oprot.writeFieldEnd(); - } - if (struct.queueName != null) { - if (struct.isSetQueueName()) { - oprot.writeFieldBegin(QUEUE_NAME_FIELD_DESC); - oprot.writeString(struct.queueName); - oprot.writeFieldEnd(); - } - } - if (struct.isSetMaxWalltime()) { - oprot.writeFieldBegin(MAX_WALLTIME_FIELD_DESC); - oprot.writeI32(struct.maxWalltime); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class HPCSettingsTupleSchemeFactory implements SchemeFactory { - public HPCSettingsTupleScheme getScheme() { - return new HPCSettingsTupleScheme(); - } - } - - private static class HPCSettingsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, HPCSettings struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetJobManager()) { - optionals.set(0); - } - if (struct.isSetCpuCount()) { - optionals.set(1); - } - if (struct.isSetNodeCount()) { - optionals.set(2); - } - if (struct.isSetQueueName()) { - optionals.set(3); - } - if (struct.isSetMaxWalltime()) { - optionals.set(4); - } - oprot.writeBitSet(optionals, 5); - if (struct.isSetJobManager()) { - oprot.writeString(struct.jobManager); - } - if (struct.isSetCpuCount()) { - oprot.writeI32(struct.cpuCount); - } - if (struct.isSetNodeCount()) { - oprot.writeI32(struct.nodeCount); - } - if (struct.isSetQueueName()) { - oprot.writeString(struct.queueName); - } - if (struct.isSetMaxWalltime()) { - oprot.writeI32(struct.maxWalltime); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, HPCSettings struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(5); - if (incoming.get(0)) { - struct.jobManager = iprot.readString(); - struct.setJobManagerIsSet(true); - } - if (incoming.get(1)) { - struct.cpuCount = iprot.readI32(); - struct.setCpuCountIsSet(true); - } - if (incoming.get(2)) { - struct.nodeCount = iprot.readI32(); - struct.setNodeCountIsSet(true); - } - if (incoming.get(3)) { - struct.queueName = iprot.readString(); - struct.setQueueNameIsSet(true); - } - if (incoming.get(4)) { - struct.maxWalltime = iprot.readI32(); - struct.setMaxWalltimeIsSet(true); - } - } - } - -} - http://git-wip-us.apache.org/repos/asf/airavata/blob/77d4925d/modules/thrift/interpreter-service/src/main/java/org/apache/airavata/experiment/execution/HostSchedulingSettings.java ---------------------------------------------------------------------- diff --git a/modules/thrift/interpreter-service/src/main/java/org/apache/airavata/experiment/execution/HostSchedulingSettings.java b/modules/thrift/interpreter-service/src/main/java/org/apache/airavata/experiment/execution/HostSchedulingSettings.java deleted file mode 100644 index f768083..0000000 --- a/modules/thrift/interpreter-service/src/main/java/org/apache/airavata/experiment/execution/HostSchedulingSettings.java +++ /dev/null @@ -1,608 +0,0 @@ -/* - * - * 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.1) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.airavata.experiment.execution; - -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class HostSchedulingSettings implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HostSchedulingSettings"); - - private static final org.apache.thrift.protocol.TField HOST_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("hostID", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField IS_WSGRAM_PREFERRED_FIELD_DESC = new org.apache.thrift.protocol.TField("isWSGramPreferred", org.apache.thrift.protocol.TType.BOOL, (short)2); - private static final org.apache.thrift.protocol.TField GATEKEEPER_EPR_FIELD_DESC = new org.apache.thrift.protocol.TField("gatekeeperEPR", org.apache.thrift.protocol.TType.STRING, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new HostSchedulingSettingsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new HostSchedulingSettingsTupleSchemeFactory()); - } - - public String hostID; // optional - public boolean isWSGramPreferred; // optional - public String gatekeeperEPR; // 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 { - HOST_ID((short)1, "hostID"), - IS_WSGRAM_PREFERRED((short)2, "isWSGramPreferred"), - GATEKEEPER_EPR((short)3, "gatekeeperEPR"); - - private static final Map byName = new HashMap(); - - 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_ID - return HOST_ID; - case 2: // IS_WSGRAM_PREFERRED - return IS_WSGRAM_PREFERRED; - case 3: // GATEKEEPER_EPR - return GATEKEEPER_EPR; - 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 __ISWSGRAMPREFERRED_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.HOST_ID,_Fields.IS_WSGRAM_PREFERRED,_Fields.GATEKEEPER_EPR}; - 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_ID, new org.apache.thrift.meta_data.FieldMetaData("hostID", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.IS_WSGRAM_PREFERRED, new org.apache.thrift.meta_data.FieldMetaData("isWSGramPreferred", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.GATEKEEPER_EPR, new org.apache.thrift.meta_data.FieldMetaData("gatekeeperEPR", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HostSchedulingSettings.class, metaDataMap); - } - - public HostSchedulingSettings() { - } - - /** - * Performs a deep copy on other. - */ - public HostSchedulingSettings(HostSchedulingSettings other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetHostID()) { - this.hostID = other.hostID; - } - this.isWSGramPreferred = other.isWSGramPreferred; - if (other.isSetGatekeeperEPR()) { - this.gatekeeperEPR = other.gatekeeperEPR; - } - } - - public HostSchedulingSettings deepCopy() { - return new HostSchedulingSettings(this); - } - - @Override - public void clear() { - this.hostID = null; - setIsWSGramPreferredIsSet(false); - this.isWSGramPreferred = false; - this.gatekeeperEPR = null; - } - - public String getHostID() { - return this.hostID; - } - - public HostSchedulingSettings setHostID(String hostID) { - this.hostID = hostID; - return this; - } - - public void unsetHostID() { - this.hostID = null; - } - - /** Returns true if field hostID is set (has been assigned a value) and false otherwise */ - public boolean isSetHostID() { - return this.hostID != null; - } - - public void setHostIDIsSet(boolean value) { - if (!value) { - this.hostID = null; - } - } - - public boolean isIsWSGramPreferred() { - return this.isWSGramPreferred; - } - - public HostSchedulingSettings setIsWSGramPreferred(boolean isWSGramPreferred) { - this.isWSGramPreferred = isWSGramPreferred; - setIsWSGramPreferredIsSet(true); - return this; - } - - public void unsetIsWSGramPreferred() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISWSGRAMPREFERRED_ISSET_ID); - } - - /** Returns true if field isWSGramPreferred is set (has been assigned a value) and false otherwise */ - public boolean isSetIsWSGramPreferred() { - return EncodingUtils.testBit(__isset_bitfield, __ISWSGRAMPREFERRED_ISSET_ID); - } - - public void setIsWSGramPreferredIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISWSGRAMPREFERRED_ISSET_ID, value); - } - - public String getGatekeeperEPR() { - return this.gatekeeperEPR; - } - - public HostSchedulingSettings setGatekeeperEPR(String gatekeeperEPR) { - this.gatekeeperEPR = gatekeeperEPR; - return this; - } - - public void unsetGatekeeperEPR() { - this.gatekeeperEPR = null; - } - - /** Returns true if field gatekeeperEPR is set (has been assigned a value) and false otherwise */ - public boolean isSetGatekeeperEPR() { - return this.gatekeeperEPR != null; - } - - public void setGatekeeperEPRIsSet(boolean value) { - if (!value) { - this.gatekeeperEPR = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case HOST_ID: - if (value == null) { - unsetHostID(); - } else { - setHostID((String)value); - } - break; - - case IS_WSGRAM_PREFERRED: - if (value == null) { - unsetIsWSGramPreferred(); - } else { - setIsWSGramPreferred((Boolean)value); - } - break; - - case GATEKEEPER_EPR: - if (value == null) { - unsetGatekeeperEPR(); - } else { - setGatekeeperEPR((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case HOST_ID: - return getHostID(); - - case IS_WSGRAM_PREFERRED: - return Boolean.valueOf(isIsWSGramPreferred()); - - case GATEKEEPER_EPR: - return getGatekeeperEPR(); - - } - 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_ID: - return isSetHostID(); - case IS_WSGRAM_PREFERRED: - return isSetIsWSGramPreferred(); - case GATEKEEPER_EPR: - return isSetGatekeeperEPR(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof HostSchedulingSettings) - return this.equals((HostSchedulingSettings)that); - return false; - } - - public boolean equals(HostSchedulingSettings that) { - if (that == null) - return false; - - boolean this_present_hostID = true && this.isSetHostID(); - boolean that_present_hostID = true && that.isSetHostID(); - if (this_present_hostID || that_present_hostID) { - if (!(this_present_hostID && that_present_hostID)) - return false; - if (!this.hostID.equals(that.hostID)) - return false; - } - - boolean this_present_isWSGramPreferred = true && this.isSetIsWSGramPreferred(); - boolean that_present_isWSGramPreferred = true && that.isSetIsWSGramPreferred(); - if (this_present_isWSGramPreferred || that_present_isWSGramPreferred) { - if (!(this_present_isWSGramPreferred && that_present_isWSGramPreferred)) - return false; - if (this.isWSGramPreferred != that.isWSGramPreferred) - return false; - } - - boolean this_present_gatekeeperEPR = true && this.isSetGatekeeperEPR(); - boolean that_present_gatekeeperEPR = true && that.isSetGatekeeperEPR(); - if (this_present_gatekeeperEPR || that_present_gatekeeperEPR) { - if (!(this_present_gatekeeperEPR && that_present_gatekeeperEPR)) - return false; - if (!this.gatekeeperEPR.equals(that.gatekeeperEPR)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(HostSchedulingSettings other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetHostID()).compareTo(other.isSetHostID()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHostID()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hostID, other.hostID); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIsWSGramPreferred()).compareTo(other.isSetIsWSGramPreferred()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIsWSGramPreferred()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isWSGramPreferred, other.isWSGramPreferred); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetGatekeeperEPR()).compareTo(other.isSetGatekeeperEPR()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetGatekeeperEPR()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatekeeperEPR, other.gatekeeperEPR); - 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("HostSchedulingSettings("); - boolean first = true; - - if (isSetHostID()) { - sb.append("hostID:"); - if (this.hostID == null) { - sb.append("null"); - } else { - sb.append(this.hostID); - } - first = false; - } - if (isSetIsWSGramPreferred()) { - if (!first) sb.append(", "); - sb.append("isWSGramPreferred:"); - sb.append(this.isWSGramPreferred); - first = false; - } - if (isSetGatekeeperEPR()) { - if (!first) sb.append(", "); - sb.append("gatekeeperEPR:"); - if (this.gatekeeperEPR == null) { - sb.append("null"); - } else { - sb.append(this.gatekeeperEPR); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // 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 HostSchedulingSettingsStandardSchemeFactory implements SchemeFactory { - public HostSchedulingSettingsStandardScheme getScheme() { - return new HostSchedulingSettingsStandardScheme(); - } - } - - private static class HostSchedulingSettingsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, HostSchedulingSettings 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_ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.hostID = iprot.readString(); - struct.setHostIDIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // IS_WSGRAM_PREFERRED - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.isWSGramPreferred = iprot.readBool(); - struct.setIsWSGramPreferredIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // GATEKEEPER_EPR - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.gatekeeperEPR = iprot.readString(); - struct.setGatekeeperEPRIsSet(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(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, HostSchedulingSettings struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.hostID != null) { - if (struct.isSetHostID()) { - oprot.writeFieldBegin(HOST_ID_FIELD_DESC); - oprot.writeString(struct.hostID); - oprot.writeFieldEnd(); - } - } - if (struct.isSetIsWSGramPreferred()) { - oprot.writeFieldBegin(IS_WSGRAM_PREFERRED_FIELD_DESC); - oprot.writeBool(struct.isWSGramPreferred); - oprot.writeFieldEnd(); - } - if (struct.gatekeeperEPR != null) { - if (struct.isSetGatekeeperEPR()) { - oprot.writeFieldBegin(GATEKEEPER_EPR_FIELD_DESC); - oprot.writeString(struct.gatekeeperEPR); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class HostSchedulingSettingsTupleSchemeFactory implements SchemeFactory { - public HostSchedulingSettingsTupleScheme getScheme() { - return new HostSchedulingSettingsTupleScheme(); - } - } - - private static class HostSchedulingSettingsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, HostSchedulingSettings struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetHostID()) { - optionals.set(0); - } - if (struct.isSetIsWSGramPreferred()) { - optionals.set(1); - } - if (struct.isSetGatekeeperEPR()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetHostID()) { - oprot.writeString(struct.hostID); - } - if (struct.isSetIsWSGramPreferred()) { - oprot.writeBool(struct.isWSGramPreferred); - } - if (struct.isSetGatekeeperEPR()) { - oprot.writeString(struct.gatekeeperEPR); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, HostSchedulingSettings struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.hostID = iprot.readString(); - struct.setHostIDIsSet(true); - } - if (incoming.get(1)) { - struct.isWSGramPreferred = iprot.readBool(); - struct.setIsWSGramPreferredIsSet(true); - } - if (incoming.get(2)) { - struct.gatekeeperEPR = iprot.readString(); - struct.setGatekeeperEPRIsSet(true); - } - } - } - -} -