http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/488b772f/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/JobUpdateKey.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/JobUpdateKey.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/JobUpdateKey.java deleted file mode 100644 index 4bd0e7f..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/JobUpdateKey.java +++ /dev/null @@ -1,554 +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.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.airavata.cloud.aurora.client.sdk; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -/** - * Job update key. - */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-21") -public class JobUpdateKey implements org.apache.thrift.TBase<JobUpdateKey, JobUpdateKey._Fields>, java.io.Serializable, Cloneable, Comparable<JobUpdateKey> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JobUpdateKey"); - - private static final org.apache.thrift.protocol.TField JOB_FIELD_DESC = new org.apache.thrift.protocol.TField("job", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new JobUpdateKeyStandardSchemeFactory()); - schemes.put(TupleScheme.class, new JobUpdateKeyTupleSchemeFactory()); - } - - /** - * Job being updated - */ - public JobKey job; // required - /** - * Update ID. - */ - public String id; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - /** - * Job being updated - */ - JOB((short)1, "job"), - /** - * Update ID. - */ - ID((short)2, "id"); - - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // JOB - return JOB; - case 2: // ID - return ID; - 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 - 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, new org.apache.thrift.meta_data.FieldMetaData("job", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JobKey.class))); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JobUpdateKey.class, metaDataMap); - } - - public JobUpdateKey() { - } - - public JobUpdateKey( - JobKey job, - String id) - { - this(); - this.job = job; - this.id = id; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public JobUpdateKey(JobUpdateKey other) { - if (other.isSetJob()) { - this.job = new JobKey(other.job); - } - if (other.isSetId()) { - this.id = other.id; - } - } - - public JobUpdateKey deepCopy() { - return new JobUpdateKey(this); - } - - @Override - public void clear() { - this.job = null; - this.id = null; - } - - /** - * Job being updated - */ - public JobKey getJob() { - return this.job; - } - - /** - * Job being updated - */ - public JobUpdateKey setJob(JobKey job) { - this.job = job; - return this; - } - - public void unsetJob() { - this.job = null; - } - - /** Returns true if field job is set (has been assigned a value) and false otherwise */ - public boolean isSetJob() { - return this.job != null; - } - - public void setJobIsSet(boolean value) { - if (!value) { - this.job = null; - } - } - - /** - * Update ID. - */ - public String getId() { - return this.id; - } - - /** - * Update ID. - */ - public JobUpdateKey setId(String id) { - this.id = id; - return this; - } - - public void unsetId() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean isSetId() { - return this.id != null; - } - - public void setIdIsSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case JOB: - if (value == null) { - unsetJob(); - } else { - setJob((JobKey)value); - } - break; - - case ID: - if (value == null) { - unsetId(); - } else { - setId((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case JOB: - return getJob(); - - case ID: - return getId(); - - } - 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: - return isSetJob(); - case ID: - return isSetId(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof JobUpdateKey) - return this.equals((JobUpdateKey)that); - return false; - } - - public boolean equals(JobUpdateKey that) { - if (that == null) - return false; - - boolean this_present_job = true && this.isSetJob(); - boolean that_present_job = true && that.isSetJob(); - if (this_present_job || that_present_job) { - if (!(this_present_job && that_present_job)) - return false; - if (!this.job.equals(that.job)) - return false; - } - - boolean this_present_id = true && this.isSetId(); - boolean that_present_id = true && that.isSetId(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List<Object> list = new ArrayList<Object>(); - - boolean present_job = true && (isSetJob()); - list.add(present_job); - if (present_job) - list.add(job); - - boolean present_id = true && (isSetId()); - list.add(present_id); - if (present_id) - list.add(id); - - return list.hashCode(); - } - - @Override - public int compareTo(JobUpdateKey other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetJob()).compareTo(other.isSetJob()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetJob()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.job, other.job); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); - 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("JobUpdateKey("); - boolean first = true; - - sb.append("job:"); - if (this.job == null) { - sb.append("null"); - } else { - sb.append(this.job); - } - first = false; - if (!first) sb.append(", "); - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (job != null) { - job.validate(); - } - } - - 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 { - 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 JobUpdateKeyStandardSchemeFactory implements SchemeFactory { - public JobUpdateKeyStandardScheme getScheme() { - return new JobUpdateKeyStandardScheme(); - } - } - - private static class JobUpdateKeyStandardScheme extends StandardScheme<JobUpdateKey> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, JobUpdateKey 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 - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.job = new JobKey(); - struct.job.read(iprot); - struct.setJobIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.id = iprot.readString(); - struct.setIdIsSet(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, JobUpdateKey struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.job != null) { - oprot.writeFieldBegin(JOB_FIELD_DESC); - struct.job.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(struct.id); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class JobUpdateKeyTupleSchemeFactory implements SchemeFactory { - public JobUpdateKeyTupleScheme getScheme() { - return new JobUpdateKeyTupleScheme(); - } - } - - private static class JobUpdateKeyTupleScheme extends TupleScheme<JobUpdateKey> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, JobUpdateKey struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetJob()) { - optionals.set(0); - } - if (struct.isSetId()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetJob()) { - struct.job.write(oprot); - } - if (struct.isSetId()) { - oprot.writeString(struct.id); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, JobUpdateKey struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.job = new JobKey(); - struct.job.read(iprot); - struct.setJobIsSet(true); - } - if (incoming.get(1)) { - struct.id = iprot.readString(); - struct.setIdIsSet(true); - } - } - } - -} -
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/488b772f/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/JobUpdatePulseStatus.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/JobUpdatePulseStatus.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/JobUpdatePulseStatus.java deleted file mode 100644 index 613c213..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/JobUpdatePulseStatus.java +++ /dev/null @@ -1,74 +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.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.airavata.cloud.aurora.client.sdk; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -/** - * Status of the coordinated update. Intended as a response to pulseJobUpdate RPC. - */ -public enum JobUpdatePulseStatus implements org.apache.thrift.TEnum { - /** - * Update is active. See ACTIVE_JOB_UPDATE_STATES for statuses considered active. - */ - OK(1), - /** - * Update has reached terminal state. See TERMINAL_JOB_UPDATE_STATES for statuses - * considered terminal. - */ - FINISHED(2); - - private final int value; - - private JobUpdatePulseStatus(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static JobUpdatePulseStatus findByValue(int value) { - switch (value) { - case 1: - return OK; - case 2: - return FINISHED; - default: - return null; - } - } -} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/488b772f/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/JobUpdateQuery.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/JobUpdateQuery.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/JobUpdateQuery.java deleted file mode 100644 index bf23841..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/JobUpdateQuery.java +++ /dev/null @@ -1,1189 +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.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.airavata.cloud.aurora.client.sdk; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -/** - * Contains a set of restrictions on matching job updates where all restrictions must be met - * (terms are AND'ed together). - */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-21") -public class JobUpdateQuery implements org.apache.thrift.TBase<JobUpdateQuery, JobUpdateQuery._Fields>, java.io.Serializable, Cloneable, Comparable<JobUpdateQuery> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JobUpdateQuery"); - - private static final org.apache.thrift.protocol.TField ROLE_FIELD_DESC = new org.apache.thrift.protocol.TField("role", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRUCT, (short)8); - private static final org.apache.thrift.protocol.TField JOB_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("jobKey", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField UPDATE_STATUSES_FIELD_DESC = new org.apache.thrift.protocol.TField("updateStatuses", org.apache.thrift.protocol.TType.SET, (short)5); - private static final org.apache.thrift.protocol.TField OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("offset", org.apache.thrift.protocol.TType.I32, (short)6); - private static final org.apache.thrift.protocol.TField LIMIT_FIELD_DESC = new org.apache.thrift.protocol.TField("limit", org.apache.thrift.protocol.TType.I32, (short)7); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new JobUpdateQueryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new JobUpdateQueryTupleSchemeFactory()); - } - - /** - * Job role. - */ - public String role; // required - /** - * Unique identifier for a job update. - */ - public JobUpdateKey key; // required - /** - * Job key. - */ - public JobKey jobKey; // required - /** - * User who created the update. - */ - public String user; // required - /** - * Set of update statuses. - */ - public Set<JobUpdateStatus> updateStatuses; // required - /** - * Offset to serve data from. Used by pagination. - */ - public int offset; // required - /** - * Number or records to serve. Used by pagination. - */ - public int limit; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - /** - * Job role. - */ - ROLE((short)2, "role"), - /** - * Unique identifier for a job update. - */ - KEY((short)8, "key"), - /** - * Job key. - */ - JOB_KEY((short)3, "jobKey"), - /** - * User who created the update. - */ - USER((short)4, "user"), - /** - * Set of update statuses. - */ - UPDATE_STATUSES((short)5, "updateStatuses"), - /** - * Offset to serve data from. Used by pagination. - */ - OFFSET((short)6, "offset"), - /** - * Number or records to serve. Used by pagination. - */ - LIMIT((short)7, "limit"); - - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 2: // ROLE - return ROLE; - case 8: // KEY - return KEY; - case 3: // JOB_KEY - return JOB_KEY; - case 4: // USER - return USER; - case 5: // UPDATE_STATUSES - return UPDATE_STATUSES; - case 6: // OFFSET - return OFFSET; - case 7: // LIMIT - return LIMIT; - 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 __OFFSET_ISSET_ID = 0; - private static final int __LIMIT_ISSET_ID = 1; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.ROLE, new org.apache.thrift.meta_data.FieldMetaData("role", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JobUpdateKey.class))); - tmpMap.put(_Fields.JOB_KEY, new org.apache.thrift.meta_data.FieldMetaData("jobKey", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JobKey.class))); - tmpMap.put(_Fields.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.UPDATE_STATUSES, new org.apache.thrift.meta_data.FieldMetaData("updateStatuses", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, JobUpdateStatus.class)))); - tmpMap.put(_Fields.OFFSET, new org.apache.thrift.meta_data.FieldMetaData("offset", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.LIMIT, new org.apache.thrift.meta_data.FieldMetaData("limit", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JobUpdateQuery.class, metaDataMap); - } - - public JobUpdateQuery() { - } - - public JobUpdateQuery( - String role, - JobUpdateKey key, - JobKey jobKey, - String user, - Set<JobUpdateStatus> updateStatuses, - int offset, - int limit) - { - this(); - this.role = role; - this.key = key; - this.jobKey = jobKey; - this.user = user; - this.updateStatuses = updateStatuses; - this.offset = offset; - setOffsetIsSet(true); - this.limit = limit; - setLimitIsSet(true); - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public JobUpdateQuery(JobUpdateQuery other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetRole()) { - this.role = other.role; - } - if (other.isSetKey()) { - this.key = new JobUpdateKey(other.key); - } - if (other.isSetJobKey()) { - this.jobKey = new JobKey(other.jobKey); - } - if (other.isSetUser()) { - this.user = other.user; - } - if (other.isSetUpdateStatuses()) { - Set<JobUpdateStatus> __this__updateStatuses = new HashSet<JobUpdateStatus>(other.updateStatuses.size()); - for (JobUpdateStatus other_element : other.updateStatuses) { - __this__updateStatuses.add(other_element); - } - this.updateStatuses = __this__updateStatuses; - } - this.offset = other.offset; - this.limit = other.limit; - } - - public JobUpdateQuery deepCopy() { - return new JobUpdateQuery(this); - } - - @Override - public void clear() { - this.role = null; - this.key = null; - this.jobKey = null; - this.user = null; - this.updateStatuses = null; - setOffsetIsSet(false); - this.offset = 0; - setLimitIsSet(false); - this.limit = 0; - } - - /** - * Job role. - */ - public String getRole() { - return this.role; - } - - /** - * Job role. - */ - public JobUpdateQuery setRole(String role) { - this.role = role; - return this; - } - - public void unsetRole() { - this.role = null; - } - - /** Returns true if field role is set (has been assigned a value) and false otherwise */ - public boolean isSetRole() { - return this.role != null; - } - - public void setRoleIsSet(boolean value) { - if (!value) { - this.role = null; - } - } - - /** - * Unique identifier for a job update. - */ - public JobUpdateKey getKey() { - return this.key; - } - - /** - * Unique identifier for a job update. - */ - public JobUpdateQuery setKey(JobUpdateKey key) { - this.key = key; - return this; - } - - public void unsetKey() { - this.key = null; - } - - /** Returns true if field key is set (has been assigned a value) and false otherwise */ - public boolean isSetKey() { - return this.key != null; - } - - public void setKeyIsSet(boolean value) { - if (!value) { - this.key = null; - } - } - - /** - * Job key. - */ - public JobKey getJobKey() { - return this.jobKey; - } - - /** - * Job key. - */ - public JobUpdateQuery setJobKey(JobKey jobKey) { - this.jobKey = jobKey; - return this; - } - - public void unsetJobKey() { - this.jobKey = null; - } - - /** Returns true if field jobKey is set (has been assigned a value) and false otherwise */ - public boolean isSetJobKey() { - return this.jobKey != null; - } - - public void setJobKeyIsSet(boolean value) { - if (!value) { - this.jobKey = null; - } - } - - /** - * User who created the update. - */ - public String getUser() { - return this.user; - } - - /** - * User who created the update. - */ - public JobUpdateQuery setUser(String user) { - this.user = user; - return this; - } - - public void unsetUser() { - this.user = null; - } - - /** Returns true if field user is set (has been assigned a value) and false otherwise */ - public boolean isSetUser() { - return this.user != null; - } - - public void setUserIsSet(boolean value) { - if (!value) { - this.user = null; - } - } - - public int getUpdateStatusesSize() { - return (this.updateStatuses == null) ? 0 : this.updateStatuses.size(); - } - - public java.util.Iterator<JobUpdateStatus> getUpdateStatusesIterator() { - return (this.updateStatuses == null) ? null : this.updateStatuses.iterator(); - } - - public void addToUpdateStatuses(JobUpdateStatus elem) { - if (this.updateStatuses == null) { - this.updateStatuses = new HashSet<JobUpdateStatus>(); - } - this.updateStatuses.add(elem); - } - - /** - * Set of update statuses. - */ - public Set<JobUpdateStatus> getUpdateStatuses() { - return this.updateStatuses; - } - - /** - * Set of update statuses. - */ - public JobUpdateQuery setUpdateStatuses(Set<JobUpdateStatus> updateStatuses) { - this.updateStatuses = updateStatuses; - return this; - } - - public void unsetUpdateStatuses() { - this.updateStatuses = null; - } - - /** Returns true if field updateStatuses is set (has been assigned a value) and false otherwise */ - public boolean isSetUpdateStatuses() { - return this.updateStatuses != null; - } - - public void setUpdateStatusesIsSet(boolean value) { - if (!value) { - this.updateStatuses = null; - } - } - - /** - * Offset to serve data from. Used by pagination. - */ - public int getOffset() { - return this.offset; - } - - /** - * Offset to serve data from. Used by pagination. - */ - public JobUpdateQuery setOffset(int offset) { - this.offset = offset; - setOffsetIsSet(true); - return this; - } - - public void unsetOffset() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OFFSET_ISSET_ID); - } - - /** Returns true if field offset is set (has been assigned a value) and false otherwise */ - public boolean isSetOffset() { - return EncodingUtils.testBit(__isset_bitfield, __OFFSET_ISSET_ID); - } - - public void setOffsetIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OFFSET_ISSET_ID, value); - } - - /** - * Number or records to serve. Used by pagination. - */ - public int getLimit() { - return this.limit; - } - - /** - * Number or records to serve. Used by pagination. - */ - public JobUpdateQuery setLimit(int limit) { - this.limit = limit; - setLimitIsSet(true); - return this; - } - - public void unsetLimit() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LIMIT_ISSET_ID); - } - - /** Returns true if field limit is set (has been assigned a value) and false otherwise */ - public boolean isSetLimit() { - return EncodingUtils.testBit(__isset_bitfield, __LIMIT_ISSET_ID); - } - - public void setLimitIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LIMIT_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ROLE: - if (value == null) { - unsetRole(); - } else { - setRole((String)value); - } - break; - - case KEY: - if (value == null) { - unsetKey(); - } else { - setKey((JobUpdateKey)value); - } - break; - - case JOB_KEY: - if (value == null) { - unsetJobKey(); - } else { - setJobKey((JobKey)value); - } - break; - - case USER: - if (value == null) { - unsetUser(); - } else { - setUser((String)value); - } - break; - - case UPDATE_STATUSES: - if (value == null) { - unsetUpdateStatuses(); - } else { - setUpdateStatuses((Set<JobUpdateStatus>)value); - } - break; - - case OFFSET: - if (value == null) { - unsetOffset(); - } else { - setOffset((Integer)value); - } - break; - - case LIMIT: - if (value == null) { - unsetLimit(); - } else { - setLimit((Integer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ROLE: - return getRole(); - - case KEY: - return getKey(); - - case JOB_KEY: - return getJobKey(); - - case USER: - return getUser(); - - case UPDATE_STATUSES: - return getUpdateStatuses(); - - case OFFSET: - return getOffset(); - - case LIMIT: - return getLimit(); - - } - 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 ROLE: - return isSetRole(); - case KEY: - return isSetKey(); - case JOB_KEY: - return isSetJobKey(); - case USER: - return isSetUser(); - case UPDATE_STATUSES: - return isSetUpdateStatuses(); - case OFFSET: - return isSetOffset(); - case LIMIT: - return isSetLimit(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof JobUpdateQuery) - return this.equals((JobUpdateQuery)that); - return false; - } - - public boolean equals(JobUpdateQuery that) { - if (that == null) - return false; - - boolean this_present_role = true && this.isSetRole(); - boolean that_present_role = true && that.isSetRole(); - if (this_present_role || that_present_role) { - if (!(this_present_role && that_present_role)) - return false; - if (!this.role.equals(that.role)) - return false; - } - - boolean this_present_key = true && this.isSetKey(); - boolean that_present_key = true && that.isSetKey(); - if (this_present_key || that_present_key) { - if (!(this_present_key && that_present_key)) - return false; - if (!this.key.equals(that.key)) - return false; - } - - boolean this_present_jobKey = true && this.isSetJobKey(); - boolean that_present_jobKey = true && that.isSetJobKey(); - if (this_present_jobKey || that_present_jobKey) { - if (!(this_present_jobKey && that_present_jobKey)) - return false; - if (!this.jobKey.equals(that.jobKey)) - return false; - } - - boolean this_present_user = true && this.isSetUser(); - boolean that_present_user = true && that.isSetUser(); - if (this_present_user || that_present_user) { - if (!(this_present_user && that_present_user)) - return false; - if (!this.user.equals(that.user)) - return false; - } - - boolean this_present_updateStatuses = true && this.isSetUpdateStatuses(); - boolean that_present_updateStatuses = true && that.isSetUpdateStatuses(); - if (this_present_updateStatuses || that_present_updateStatuses) { - if (!(this_present_updateStatuses && that_present_updateStatuses)) - return false; - if (!this.updateStatuses.equals(that.updateStatuses)) - return false; - } - - boolean this_present_offset = true; - boolean that_present_offset = true; - if (this_present_offset || that_present_offset) { - if (!(this_present_offset && that_present_offset)) - return false; - if (this.offset != that.offset) - return false; - } - - boolean this_present_limit = true; - boolean that_present_limit = true; - if (this_present_limit || that_present_limit) { - if (!(this_present_limit && that_present_limit)) - return false; - if (this.limit != that.limit) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List<Object> list = new ArrayList<Object>(); - - boolean present_role = true && (isSetRole()); - list.add(present_role); - if (present_role) - list.add(role); - - boolean present_key = true && (isSetKey()); - list.add(present_key); - if (present_key) - list.add(key); - - boolean present_jobKey = true && (isSetJobKey()); - list.add(present_jobKey); - if (present_jobKey) - list.add(jobKey); - - boolean present_user = true && (isSetUser()); - list.add(present_user); - if (present_user) - list.add(user); - - boolean present_updateStatuses = true && (isSetUpdateStatuses()); - list.add(present_updateStatuses); - if (present_updateStatuses) - list.add(updateStatuses); - - boolean present_offset = true; - list.add(present_offset); - if (present_offset) - list.add(offset); - - boolean present_limit = true; - list.add(present_limit); - if (present_limit) - list.add(limit); - - return list.hashCode(); - } - - @Override - public int compareTo(JobUpdateQuery other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetRole()).compareTo(other.isSetRole()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRole()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.role, other.role); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetKey()).compareTo(other.isSetKey()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKey()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, other.key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetJobKey()).compareTo(other.isSetJobKey()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetJobKey()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jobKey, other.jobKey); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUser()).compareTo(other.isSetUser()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUser()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, other.user); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUpdateStatuses()).compareTo(other.isSetUpdateStatuses()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUpdateStatuses()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updateStatuses, other.updateStatuses); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOffset()).compareTo(other.isSetOffset()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOffset()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.offset, other.offset); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLimit()).compareTo(other.isSetLimit()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLimit()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limit, other.limit); - 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("JobUpdateQuery("); - boolean first = true; - - sb.append("role:"); - if (this.role == null) { - sb.append("null"); - } else { - sb.append(this.role); - } - first = false; - if (!first) sb.append(", "); - sb.append("key:"); - if (this.key == null) { - sb.append("null"); - } else { - sb.append(this.key); - } - first = false; - if (!first) sb.append(", "); - sb.append("jobKey:"); - if (this.jobKey == null) { - sb.append("null"); - } else { - sb.append(this.jobKey); - } - first = false; - if (!first) sb.append(", "); - sb.append("user:"); - if (this.user == null) { - sb.append("null"); - } else { - sb.append(this.user); - } - first = false; - if (!first) sb.append(", "); - sb.append("updateStatuses:"); - if (this.updateStatuses == null) { - sb.append("null"); - } else { - sb.append(this.updateStatuses); - } - first = false; - if (!first) sb.append(", "); - sb.append("offset:"); - sb.append(this.offset); - first = false; - if (!first) sb.append(", "); - sb.append("limit:"); - sb.append(this.limit); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (key != null) { - key.validate(); - } - if (jobKey != null) { - jobKey.validate(); - } - } - - 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 JobUpdateQueryStandardSchemeFactory implements SchemeFactory { - public JobUpdateQueryStandardScheme getScheme() { - return new JobUpdateQueryStandardScheme(); - } - } - - private static class JobUpdateQueryStandardScheme extends StandardScheme<JobUpdateQuery> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, JobUpdateQuery 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 2: // ROLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.role = iprot.readString(); - struct.setRoleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 8: // KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.key = new JobUpdateKey(); - struct.key.read(iprot); - struct.setKeyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // JOB_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.jobKey = new JobKey(); - struct.jobKey.read(iprot); - struct.setJobKeyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // USER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.user = iprot.readString(); - struct.setUserIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // UPDATE_STATUSES - if (schemeField.type == org.apache.thrift.protocol.TType.SET) { - { - org.apache.thrift.protocol.TSet _set246 = iprot.readSetBegin(); - struct.updateStatuses = new HashSet<JobUpdateStatus>(2*_set246.size); - JobUpdateStatus _elem247; - for (int _i248 = 0; _i248 < _set246.size; ++_i248) - { - _elem247 = org.apache.airavata.cloud.aurora.client.sdk.JobUpdateStatus.findByValue(iprot.readI32()); - struct.updateStatuses.add(_elem247); - } - iprot.readSetEnd(); - } - struct.setUpdateStatusesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // OFFSET - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.offset = iprot.readI32(); - struct.setOffsetIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 7: // LIMIT - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.limit = iprot.readI32(); - struct.setLimitIsSet(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, JobUpdateQuery struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.role != null) { - oprot.writeFieldBegin(ROLE_FIELD_DESC); - oprot.writeString(struct.role); - oprot.writeFieldEnd(); - } - if (struct.jobKey != null) { - oprot.writeFieldBegin(JOB_KEY_FIELD_DESC); - struct.jobKey.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.user != null) { - oprot.writeFieldBegin(USER_FIELD_DESC); - oprot.writeString(struct.user); - oprot.writeFieldEnd(); - } - if (struct.updateStatuses != null) { - oprot.writeFieldBegin(UPDATE_STATUSES_FIELD_DESC); - { - oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, struct.updateStatuses.size())); - for (JobUpdateStatus _iter249 : struct.updateStatuses) - { - oprot.writeI32(_iter249.getValue()); - } - oprot.writeSetEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(OFFSET_FIELD_DESC); - oprot.writeI32(struct.offset); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(LIMIT_FIELD_DESC); - oprot.writeI32(struct.limit); - oprot.writeFieldEnd(); - if (struct.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - struct.key.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class JobUpdateQueryTupleSchemeFactory implements SchemeFactory { - public JobUpdateQueryTupleScheme getScheme() { - return new JobUpdateQueryTupleScheme(); - } - } - - private static class JobUpdateQueryTupleScheme extends TupleScheme<JobUpdateQuery> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, JobUpdateQuery struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetRole()) { - optionals.set(0); - } - if (struct.isSetKey()) { - optionals.set(1); - } - if (struct.isSetJobKey()) { - optionals.set(2); - } - if (struct.isSetUser()) { - optionals.set(3); - } - if (struct.isSetUpdateStatuses()) { - optionals.set(4); - } - if (struct.isSetOffset()) { - optionals.set(5); - } - if (struct.isSetLimit()) { - optionals.set(6); - } - oprot.writeBitSet(optionals, 7); - if (struct.isSetRole()) { - oprot.writeString(struct.role); - } - if (struct.isSetKey()) { - struct.key.write(oprot); - } - if (struct.isSetJobKey()) { - struct.jobKey.write(oprot); - } - if (struct.isSetUser()) { - oprot.writeString(struct.user); - } - if (struct.isSetUpdateStatuses()) { - { - oprot.writeI32(struct.updateStatuses.size()); - for (JobUpdateStatus _iter250 : struct.updateStatuses) - { - oprot.writeI32(_iter250.getValue()); - } - } - } - if (struct.isSetOffset()) { - oprot.writeI32(struct.offset); - } - if (struct.isSetLimit()) { - oprot.writeI32(struct.limit); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, JobUpdateQuery struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(7); - if (incoming.get(0)) { - struct.role = iprot.readString(); - struct.setRoleIsSet(true); - } - if (incoming.get(1)) { - struct.key = new JobUpdateKey(); - struct.key.read(iprot); - struct.setKeyIsSet(true); - } - if (incoming.get(2)) { - struct.jobKey = new JobKey(); - struct.jobKey.read(iprot); - struct.setJobKeyIsSet(true); - } - if (incoming.get(3)) { - struct.user = iprot.readString(); - struct.setUserIsSet(true); - } - if (incoming.get(4)) { - { - org.apache.thrift.protocol.TSet _set251 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.updateStatuses = new HashSet<JobUpdateStatus>(2*_set251.size); - JobUpdateStatus _elem252; - for (int _i253 = 0; _i253 < _set251.size; ++_i253) - { - _elem252 = org.apache.airavata.cloud.aurora.client.sdk.JobUpdateStatus.findByValue(iprot.readI32()); - struct.updateStatuses.add(_elem252); - } - } - struct.setUpdateStatusesIsSet(true); - } - if (incoming.get(5)) { - struct.offset = iprot.readI32(); - struct.setOffsetIsSet(true); - } - if (incoming.get(6)) { - struct.limit = iprot.readI32(); - struct.setLimitIsSet(true); - } - } - } - -} - http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/488b772f/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/JobUpdateRequest.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/JobUpdateRequest.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/JobUpdateRequest.java deleted file mode 100644 index f15a39d..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/JobUpdateRequest.java +++ /dev/null @@ -1,848 +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.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.airavata.cloud.aurora.client.sdk; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -/** - * A request to update the following instances of an existing job. Used by startUpdate. - */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-21") -public class JobUpdateRequest implements org.apache.thrift.TBase<JobUpdateRequest, JobUpdateRequest._Fields>, java.io.Serializable, Cloneable, Comparable<JobUpdateRequest> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JobUpdateRequest"); - - private static final org.apache.thrift.protocol.TField TASK_CONFIG_FIELD_DESC = new org.apache.thrift.protocol.TField("taskConfig", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField INSTANCE_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("instanceCount", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField SETTINGS_FIELD_DESC = new org.apache.thrift.protocol.TField("settings", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("metadata", org.apache.thrift.protocol.TType.SET, (short)4); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new JobUpdateRequestStandardSchemeFactory()); - schemes.put(TupleScheme.class, new JobUpdateRequestTupleSchemeFactory()); - } - - /** - * Desired TaskConfig to apply. - */ - public TaskConfig taskConfig; // required - /** - * Desired number of instances of the task config. - */ - public int instanceCount; // required - /** - * Update settings and limits. - */ - public JobUpdateSettings settings; // required - /** - * Update metadata supplied by the client issuing the JobUpdateRequest. - */ - public Set<Metadata> metadata; // 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 { - /** - * Desired TaskConfig to apply. - */ - TASK_CONFIG((short)1, "taskConfig"), - /** - * Desired number of instances of the task config. - */ - INSTANCE_COUNT((short)2, "instanceCount"), - /** - * Update settings and limits. - */ - SETTINGS((short)3, "settings"), - /** - * Update metadata supplied by the client issuing the JobUpdateRequest. - */ - METADATA((short)4, "metadata"); - - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // TASK_CONFIG - return TASK_CONFIG; - case 2: // INSTANCE_COUNT - return INSTANCE_COUNT; - case 3: // SETTINGS - return SETTINGS; - case 4: // METADATA - return METADATA; - 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 __INSTANCECOUNT_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.METADATA}; - 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.TASK_CONFIG, new org.apache.thrift.meta_data.FieldMetaData("taskConfig", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TaskConfig.class))); - tmpMap.put(_Fields.INSTANCE_COUNT, new org.apache.thrift.meta_data.FieldMetaData("instanceCount", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.SETTINGS, new org.apache.thrift.meta_data.FieldMetaData("settings", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JobUpdateSettings.class))); - tmpMap.put(_Fields.METADATA, new org.apache.thrift.meta_data.FieldMetaData("metadata", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Metadata.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JobUpdateRequest.class, metaDataMap); - } - - public JobUpdateRequest() { - } - - public JobUpdateRequest( - TaskConfig taskConfig, - int instanceCount, - JobUpdateSettings settings) - { - this(); - this.taskConfig = taskConfig; - this.instanceCount = instanceCount; - setInstanceCountIsSet(true); - this.settings = settings; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public JobUpdateRequest(JobUpdateRequest other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetTaskConfig()) { - this.taskConfig = new TaskConfig(other.taskConfig); - } - this.instanceCount = other.instanceCount; - if (other.isSetSettings()) { - this.settings = new JobUpdateSettings(other.settings); - } - if (other.isSetMetadata()) { - Set<Metadata> __this__metadata = new HashSet<Metadata>(other.metadata.size()); - for (Metadata other_element : other.metadata) { - __this__metadata.add(new Metadata(other_element)); - } - this.metadata = __this__metadata; - } - } - - public JobUpdateRequest deepCopy() { - return new JobUpdateRequest(this); - } - - @Override - public void clear() { - this.taskConfig = null; - setInstanceCountIsSet(false); - this.instanceCount = 0; - this.settings = null; - this.metadata = null; - } - - /** - * Desired TaskConfig to apply. - */ - public TaskConfig getTaskConfig() { - return this.taskConfig; - } - - /** - * Desired TaskConfig to apply. - */ - public JobUpdateRequest setTaskConfig(TaskConfig taskConfig) { - this.taskConfig = taskConfig; - return this; - } - - public void unsetTaskConfig() { - this.taskConfig = null; - } - - /** Returns true if field taskConfig is set (has been assigned a value) and false otherwise */ - public boolean isSetTaskConfig() { - return this.taskConfig != null; - } - - public void setTaskConfigIsSet(boolean value) { - if (!value) { - this.taskConfig = null; - } - } - - /** - * Desired number of instances of the task config. - */ - public int getInstanceCount() { - return this.instanceCount; - } - - /** - * Desired number of instances of the task config. - */ - public JobUpdateRequest setInstanceCount(int instanceCount) { - this.instanceCount = instanceCount; - setInstanceCountIsSet(true); - return this; - } - - public void unsetInstanceCount() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INSTANCECOUNT_ISSET_ID); - } - - /** Returns true if field instanceCount is set (has been assigned a value) and false otherwise */ - public boolean isSetInstanceCount() { - return EncodingUtils.testBit(__isset_bitfield, __INSTANCECOUNT_ISSET_ID); - } - - public void setInstanceCountIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INSTANCECOUNT_ISSET_ID, value); - } - - /** - * Update settings and limits. - */ - public JobUpdateSettings getSettings() { - return this.settings; - } - - /** - * Update settings and limits. - */ - public JobUpdateRequest setSettings(JobUpdateSettings settings) { - this.settings = settings; - return this; - } - - public void unsetSettings() { - this.settings = null; - } - - /** Returns true if field settings is set (has been assigned a value) and false otherwise */ - public boolean isSetSettings() { - return this.settings != null; - } - - public void setSettingsIsSet(boolean value) { - if (!value) { - this.settings = null; - } - } - - public int getMetadataSize() { - return (this.metadata == null) ? 0 : this.metadata.size(); - } - - public java.util.Iterator<Metadata> getMetadataIterator() { - return (this.metadata == null) ? null : this.metadata.iterator(); - } - - public void addToMetadata(Metadata elem) { - if (this.metadata == null) { - this.metadata = new HashSet<Metadata>(); - } - this.metadata.add(elem); - } - - /** - * Update metadata supplied by the client issuing the JobUpdateRequest. - */ - public Set<Metadata> getMetadata() { - return this.metadata; - } - - /** - * Update metadata supplied by the client issuing the JobUpdateRequest. - */ - public JobUpdateRequest setMetadata(Set<Metadata> metadata) { - this.metadata = metadata; - return this; - } - - public void unsetMetadata() { - this.metadata = null; - } - - /** Returns true if field metadata is set (has been assigned a value) and false otherwise */ - public boolean isSetMetadata() { - return this.metadata != null; - } - - public void setMetadataIsSet(boolean value) { - if (!value) { - this.metadata = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case TASK_CONFIG: - if (value == null) { - unsetTaskConfig(); - } else { - setTaskConfig((TaskConfig)value); - } - break; - - case INSTANCE_COUNT: - if (value == null) { - unsetInstanceCount(); - } else { - setInstanceCount((Integer)value); - } - break; - - case SETTINGS: - if (value == null) { - unsetSettings(); - } else { - setSettings((JobUpdateSettings)value); - } - break; - - case METADATA: - if (value == null) { - unsetMetadata(); - } else { - setMetadata((Set<Metadata>)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case TASK_CONFIG: - return getTaskConfig(); - - case INSTANCE_COUNT: - return getInstanceCount(); - - case SETTINGS: - return getSettings(); - - case METADATA: - return getMetadata(); - - } - 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 TASK_CONFIG: - return isSetTaskConfig(); - case INSTANCE_COUNT: - return isSetInstanceCount(); - case SETTINGS: - return isSetSettings(); - case METADATA: - return isSetMetadata(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof JobUpdateRequest) - return this.equals((JobUpdateRequest)that); - return false; - } - - public boolean equals(JobUpdateRequest that) { - if (that == null) - return false; - - boolean this_present_taskConfig = true && this.isSetTaskConfig(); - boolean that_present_taskConfig = true && that.isSetTaskConfig(); - if (this_present_taskConfig || that_present_taskConfig) { - if (!(this_present_taskConfig && that_present_taskConfig)) - return false; - if (!this.taskConfig.equals(that.taskConfig)) - return false; - } - - boolean this_present_instanceCount = true; - boolean that_present_instanceCount = true; - if (this_present_instanceCount || that_present_instanceCount) { - if (!(this_present_instanceCount && that_present_instanceCount)) - return false; - if (this.instanceCount != that.instanceCount) - return false; - } - - boolean this_present_settings = true && this.isSetSettings(); - boolean that_present_settings = true && that.isSetSettings(); - if (this_present_settings || that_present_settings) { - if (!(this_present_settings && that_present_settings)) - return false; - if (!this.settings.equals(that.settings)) - return false; - } - - boolean this_present_metadata = true && this.isSetMetadata(); - boolean that_present_metadata = true && that.isSetMetadata(); - if (this_present_metadata || that_present_metadata) { - if (!(this_present_metadata && that_present_metadata)) - return false; - if (!this.metadata.equals(that.metadata)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List<Object> list = new ArrayList<Object>(); - - boolean present_taskConfig = true && (isSetTaskConfig()); - list.add(present_taskConfig); - if (present_taskConfig) - list.add(taskConfig); - - boolean present_instanceCount = true; - list.add(present_instanceCount); - if (present_instanceCount) - list.add(instanceCount); - - boolean present_settings = true && (isSetSettings()); - list.add(present_settings); - if (present_settings) - list.add(settings); - - boolean present_metadata = true && (isSetMetadata()); - list.add(present_metadata); - if (present_metadata) - list.add(metadata); - - return list.hashCode(); - } - - @Override - public int compareTo(JobUpdateRequest other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetTaskConfig()).compareTo(other.isSetTaskConfig()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTaskConfig()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskConfig, other.taskConfig); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetInstanceCount()).compareTo(other.isSetInstanceCount()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetInstanceCount()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.instanceCount, other.instanceCount); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSettings()).compareTo(other.isSetSettings()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSettings()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.settings, other.settings); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMetadata()).compareTo(other.isSetMetadata()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMetadata()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metadata, other.metadata); - 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("JobUpdateRequest("); - boolean first = true; - - sb.append("taskConfig:"); - if (this.taskConfig == null) { - sb.append("null"); - } else { - sb.append(this.taskConfig); - } - first = false; - if (!first) sb.append(", "); - sb.append("instanceCount:"); - sb.append(this.instanceCount); - first = false; - if (!first) sb.append(", "); - sb.append("settings:"); - if (this.settings == null) { - sb.append("null"); - } else { - sb.append(this.settings); - } - first = false; - if (isSetMetadata()) { - if (!first) sb.append(", "); - sb.append("metadata:"); - if (this.metadata == null) { - sb.append("null"); - } else { - sb.append(this.metadata); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (taskConfig != null) { - taskConfig.validate(); - } - if (settings != null) { - settings.validate(); - } - } - - 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 JobUpdateRequestStandardSchemeFactory implements SchemeFactory { - public JobUpdateRequestStandardScheme getScheme() { - return new JobUpdateRequestStandardScheme(); - } - } - - private static class JobUpdateRequestStandardScheme extends StandardScheme<JobUpdateRequest> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, JobUpdateRequest 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: // TASK_CONFIG - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.taskConfig = new TaskConfig(); - struct.taskConfig.read(iprot); - struct.setTaskConfigIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // INSTANCE_COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.instanceCount = iprot.readI32(); - struct.setInstanceCountIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SETTINGS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.settings = new JobUpdateSettings(); - struct.settings.read(iprot); - struct.setSettingsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // METADATA - if (schemeField.type == org.apache.thrift.protocol.TType.SET) { - { - org.apache.thrift.protocol.TSet _set238 = iprot.readSetBegin(); - struct.metadata = new HashSet<Metadata>(2*_set238.size); - Metadata _elem239; - for (int _i240 = 0; _i240 < _set238.size; ++_i240) - { - _elem239 = new Metadata(); - _elem239.read(iprot); - struct.metadata.add(_elem239); - } - iprot.readSetEnd(); - } - struct.setMetadataIsSet(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, JobUpdateRequest struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.taskConfig != null) { - oprot.writeFieldBegin(TASK_CONFIG_FIELD_DESC); - struct.taskConfig.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(INSTANCE_COUNT_FIELD_DESC); - oprot.writeI32(struct.instanceCount); - oprot.writeFieldEnd(); - if (struct.settings != null) { - oprot.writeFieldBegin(SETTINGS_FIELD_DESC); - struct.settings.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.metadata != null) { - if (struct.isSetMetadata()) { - oprot.writeFieldBegin(METADATA_FIELD_DESC); - { - oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, struct.metadata.size())); - for (Metadata _iter241 : struct.metadata) - { - _iter241.write(oprot); - } - oprot.writeSetEnd(); - } - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class JobUpdateRequestTupleSchemeFactory implements SchemeFactory { - public JobUpdateRequestTupleScheme getScheme() { - return new JobUpdateRequestTupleScheme(); - } - } - - private static class JobUpdateRequestTupleScheme extends TupleScheme<JobUpdateRequest> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, JobUpdateRequest struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetTaskConfig()) { - optionals.set(0); - } - if (struct.isSetInstanceCount()) { - optionals.set(1); - } - if (struct.isSetSettings()) { - optionals.set(2); - } - if (struct.isSetMetadata()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetTaskConfig()) { - struct.taskConfig.write(oprot); - } - if (struct.isSetInstanceCount()) { - oprot.writeI32(struct.instanceCount); - } - if (struct.isSetSettings()) { - struct.settings.write(oprot); - } - if (struct.isSetMetadata()) { - { - oprot.writeI32(struct.metadata.size()); - for (Metadata _iter242 : struct.metadata) - { - _iter242.write(oprot); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, JobUpdateRequest struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(4); - if (incoming.get(0)) { - struct.taskConfig = new TaskConfig(); - struct.taskConfig.read(iprot); - struct.setTaskConfigIsSet(true); - } - if (incoming.get(1)) { - struct.instanceCount = iprot.readI32(); - struct.setInstanceCountIsSet(true); - } - if (incoming.get(2)) { - struct.settings = new JobUpdateSettings(); - struct.settings.read(iprot); - struct.setSettingsIsSet(true); - } - if (incoming.get(3)) { - { - org.apache.thrift.protocol.TSet _set243 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.metadata = new HashSet<Metadata>(2*_set243.size); - Metadata _elem244; - for (int _i245 = 0; _i245 < _set243.size; ++_i245) - { - _elem244 = new Metadata(); - _elem244.read(iprot); - struct.metadata.add(_elem244); - } - } - struct.setMetadataIsSet(true); - } - } - } - -} -
