You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ch...@apache.org on 2014/10/06 21:54:51 UTC
[03/23] adding initial messaging framework changes
http://git-wip-us.apache.org/repos/asf/airavata/blob/1fe3d1d8/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/ExperimentStatusChangeEvent.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/ExperimentStatusChangeEvent.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/ExperimentStatusChangeEvent.java
new file mode 100644
index 0000000..bf84876
--- /dev/null
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/ExperimentStatusChangeEvent.java
@@ -0,0 +1,504 @@
+/**
+ * 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.model.messaging.event;
+
+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;
+
+@SuppressWarnings("all") public class ExperimentStatusChangeEvent implements org.apache.thrift.TBase<ExperimentStatusChangeEvent, ExperimentStatusChangeEvent._Fields>, java.io.Serializable, Cloneable, Comparable<ExperimentStatusChangeEvent> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExperimentStatusChangeEvent");
+
+ private static final org.apache.thrift.protocol.TField STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("state", org.apache.thrift.protocol.TType.I32, (short)1);
+ private static final org.apache.thrift.protocol.TField EXPERIMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("experimentId", 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 ExperimentStatusChangeEventStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new ExperimentStatusChangeEventTupleSchemeFactory());
+ }
+
+ private org.apache.airavata.model.workspace.experiment.ExperimentState state; // required
+ private String experimentId; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ /**
+ *
+ * @see org.apache.airavata.model.workspace.experiment.ExperimentState
+ */
+ STATE((short)1, "state"),
+ EXPERIMENT_ID((short)2, "experimentId");
+
+ 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: // STATE
+ return STATE;
+ case 2: // EXPERIMENT_ID
+ return EXPERIMENT_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.STATE, new org.apache.thrift.meta_data.FieldMetaData("state", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, org.apache.airavata.model.workspace.experiment.ExperimentState.class)));
+ tmpMap.put(_Fields.EXPERIMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("experimentId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExperimentStatusChangeEvent.class, metaDataMap);
+ }
+
+ public ExperimentStatusChangeEvent() {
+ }
+
+ public ExperimentStatusChangeEvent(
+ org.apache.airavata.model.workspace.experiment.ExperimentState state,
+ String experimentId)
+ {
+ this();
+ this.state = state;
+ this.experimentId = experimentId;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public ExperimentStatusChangeEvent(ExperimentStatusChangeEvent other) {
+ if (other.isSetState()) {
+ this.state = other.state;
+ }
+ if (other.isSetExperimentId()) {
+ this.experimentId = other.experimentId;
+ }
+ }
+
+ public ExperimentStatusChangeEvent deepCopy() {
+ return new ExperimentStatusChangeEvent(this);
+ }
+
+ @Override
+ public void clear() {
+ this.state = null;
+ this.experimentId = null;
+ }
+
+ /**
+ *
+ * @see org.apache.airavata.model.workspace.experiment.ExperimentState
+ */
+ public org.apache.airavata.model.workspace.experiment.ExperimentState getState() {
+ return this.state;
+ }
+
+ /**
+ *
+ * @see org.apache.airavata.model.workspace.experiment.ExperimentState
+ */
+ public void setState(org.apache.airavata.model.workspace.experiment.ExperimentState state) {
+ this.state = state;
+ }
+
+ public void unsetState() {
+ this.state = null;
+ }
+
+ /** Returns true if field state is set (has been assigned a value) and false otherwise */
+ public boolean isSetState() {
+ return this.state != null;
+ }
+
+ public void setStateIsSet(boolean value) {
+ if (!value) {
+ this.state = null;
+ }
+ }
+
+ public String getExperimentId() {
+ return this.experimentId;
+ }
+
+ public void setExperimentId(String experimentId) {
+ this.experimentId = experimentId;
+ }
+
+ public void unsetExperimentId() {
+ this.experimentId = null;
+ }
+
+ /** Returns true if field experimentId is set (has been assigned a value) and false otherwise */
+ public boolean isSetExperimentId() {
+ return this.experimentId != null;
+ }
+
+ public void setExperimentIdIsSet(boolean value) {
+ if (!value) {
+ this.experimentId = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case STATE:
+ if (value == null) {
+ unsetState();
+ } else {
+ setState((org.apache.airavata.model.workspace.experiment.ExperimentState)value);
+ }
+ break;
+
+ case EXPERIMENT_ID:
+ if (value == null) {
+ unsetExperimentId();
+ } else {
+ setExperimentId((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case STATE:
+ return getState();
+
+ case EXPERIMENT_ID:
+ return getExperimentId();
+
+ }
+ 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 STATE:
+ return isSetState();
+ case EXPERIMENT_ID:
+ return isSetExperimentId();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof ExperimentStatusChangeEvent)
+ return this.equals((ExperimentStatusChangeEvent)that);
+ return false;
+ }
+
+ public boolean equals(ExperimentStatusChangeEvent that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_state = true && this.isSetState();
+ boolean that_present_state = true && that.isSetState();
+ if (this_present_state || that_present_state) {
+ if (!(this_present_state && that_present_state))
+ return false;
+ if (!this.state.equals(that.state))
+ return false;
+ }
+
+ boolean this_present_experimentId = true && this.isSetExperimentId();
+ boolean that_present_experimentId = true && that.isSetExperimentId();
+ if (this_present_experimentId || that_present_experimentId) {
+ if (!(this_present_experimentId && that_present_experimentId))
+ return false;
+ if (!this.experimentId.equals(that.experimentId))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(ExperimentStatusChangeEvent other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetState()).compareTo(other.isSetState());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetState()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.state, other.state);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetExperimentId()).compareTo(other.isSetExperimentId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetExperimentId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.experimentId, other.experimentId);
+ 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("ExperimentStatusChangeEvent(");
+ boolean first = true;
+
+ sb.append("state:");
+ if (this.state == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.state);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("experimentId:");
+ if (this.experimentId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.experimentId);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (!isSetState()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'state' is unset! Struct:" + toString());
+ }
+
+ if (!isSetExperimentId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'experimentId' is unset! Struct:" + toString());
+ }
+
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ 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 ExperimentStatusChangeEventStandardSchemeFactory implements SchemeFactory {
+ public ExperimentStatusChangeEventStandardScheme getScheme() {
+ return new ExperimentStatusChangeEventStandardScheme();
+ }
+ }
+
+ private static class ExperimentStatusChangeEventStandardScheme extends StandardScheme<ExperimentStatusChangeEvent> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, ExperimentStatusChangeEvent 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: // STATE
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.state = org.apache.airavata.model.workspace.experiment.ExperimentState.findByValue(iprot.readI32());
+ struct.setStateIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // EXPERIMENT_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.experimentId = iprot.readString();
+ struct.setExperimentIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, ExperimentStatusChangeEvent struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.state != null) {
+ oprot.writeFieldBegin(STATE_FIELD_DESC);
+ oprot.writeI32(struct.state.getValue());
+ oprot.writeFieldEnd();
+ }
+ if (struct.experimentId != null) {
+ oprot.writeFieldBegin(EXPERIMENT_ID_FIELD_DESC);
+ oprot.writeString(struct.experimentId);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class ExperimentStatusChangeEventTupleSchemeFactory implements SchemeFactory {
+ public ExperimentStatusChangeEventTupleScheme getScheme() {
+ return new ExperimentStatusChangeEventTupleScheme();
+ }
+ }
+
+ private static class ExperimentStatusChangeEventTupleScheme extends TupleScheme<ExperimentStatusChangeEvent> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, ExperimentStatusChangeEvent struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ oprot.writeI32(struct.state.getValue());
+ oprot.writeString(struct.experimentId);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, ExperimentStatusChangeEvent struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.state = org.apache.airavata.model.workspace.experiment.ExperimentState.findByValue(iprot.readI32());
+ struct.setStateIsSet(true);
+ struct.experimentId = iprot.readString();
+ struct.setExperimentIdIsSet(true);
+ }
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/airavata/blob/1fe3d1d8/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobIdentity.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobIdentity.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobIdentity.java
new file mode 100644
index 0000000..af97076
--- /dev/null
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobIdentity.java
@@ -0,0 +1,684 @@
+/**
+ * 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.model.messaging.event;
+
+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;
+
+@SuppressWarnings("all") public class JobIdentity implements org.apache.thrift.TBase<JobIdentity, JobIdentity._Fields>, java.io.Serializable, Cloneable, Comparable<JobIdentity> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JobIdentity");
+
+ private static final org.apache.thrift.protocol.TField JOB_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("jobId", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField TASK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("taskId", org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField WORKFLOW_NODE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("workflowNodeId", org.apache.thrift.protocol.TType.STRING, (short)3);
+ private static final org.apache.thrift.protocol.TField EXPERIMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("experimentId", org.apache.thrift.protocol.TType.STRING, (short)4);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new JobIdentityStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new JobIdentityTupleSchemeFactory());
+ }
+
+ private String jobId; // required
+ private String taskId; // required
+ private String workflowNodeId; // required
+ private String experimentId; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ JOB_ID((short)1, "jobId"),
+ TASK_ID((short)2, "taskId"),
+ WORKFLOW_NODE_ID((short)3, "workflowNodeId"),
+ EXPERIMENT_ID((short)4, "experimentId");
+
+ 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_ID
+ return JOB_ID;
+ case 2: // TASK_ID
+ return TASK_ID;
+ case 3: // WORKFLOW_NODE_ID
+ return WORKFLOW_NODE_ID;
+ case 4: // EXPERIMENT_ID
+ return EXPERIMENT_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_ID, new org.apache.thrift.meta_data.FieldMetaData("jobId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.TASK_ID, new org.apache.thrift.meta_data.FieldMetaData("taskId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.WORKFLOW_NODE_ID, new org.apache.thrift.meta_data.FieldMetaData("workflowNodeId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.EXPERIMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("experimentId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JobIdentity.class, metaDataMap);
+ }
+
+ public JobIdentity() {
+ }
+
+ public JobIdentity(
+ String jobId,
+ String taskId,
+ String workflowNodeId,
+ String experimentId)
+ {
+ this();
+ this.jobId = jobId;
+ this.taskId = taskId;
+ this.workflowNodeId = workflowNodeId;
+ this.experimentId = experimentId;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public JobIdentity(JobIdentity other) {
+ if (other.isSetJobId()) {
+ this.jobId = other.jobId;
+ }
+ if (other.isSetTaskId()) {
+ this.taskId = other.taskId;
+ }
+ if (other.isSetWorkflowNodeId()) {
+ this.workflowNodeId = other.workflowNodeId;
+ }
+ if (other.isSetExperimentId()) {
+ this.experimentId = other.experimentId;
+ }
+ }
+
+ public JobIdentity deepCopy() {
+ return new JobIdentity(this);
+ }
+
+ @Override
+ public void clear() {
+ this.jobId = null;
+ this.taskId = null;
+ this.workflowNodeId = null;
+ this.experimentId = null;
+ }
+
+ public String getJobId() {
+ return this.jobId;
+ }
+
+ public void setJobId(String jobId) {
+ this.jobId = jobId;
+ }
+
+ public void unsetJobId() {
+ this.jobId = null;
+ }
+
+ /** Returns true if field jobId is set (has been assigned a value) and false otherwise */
+ public boolean isSetJobId() {
+ return this.jobId != null;
+ }
+
+ public void setJobIdIsSet(boolean value) {
+ if (!value) {
+ this.jobId = null;
+ }
+ }
+
+ public String getTaskId() {
+ return this.taskId;
+ }
+
+ public void setTaskId(String taskId) {
+ this.taskId = taskId;
+ }
+
+ public void unsetTaskId() {
+ this.taskId = null;
+ }
+
+ /** Returns true if field taskId is set (has been assigned a value) and false otherwise */
+ public boolean isSetTaskId() {
+ return this.taskId != null;
+ }
+
+ public void setTaskIdIsSet(boolean value) {
+ if (!value) {
+ this.taskId = null;
+ }
+ }
+
+ public String getWorkflowNodeId() {
+ return this.workflowNodeId;
+ }
+
+ public void setWorkflowNodeId(String workflowNodeId) {
+ this.workflowNodeId = workflowNodeId;
+ }
+
+ public void unsetWorkflowNodeId() {
+ this.workflowNodeId = null;
+ }
+
+ /** Returns true if field workflowNodeId is set (has been assigned a value) and false otherwise */
+ public boolean isSetWorkflowNodeId() {
+ return this.workflowNodeId != null;
+ }
+
+ public void setWorkflowNodeIdIsSet(boolean value) {
+ if (!value) {
+ this.workflowNodeId = null;
+ }
+ }
+
+ public String getExperimentId() {
+ return this.experimentId;
+ }
+
+ public void setExperimentId(String experimentId) {
+ this.experimentId = experimentId;
+ }
+
+ public void unsetExperimentId() {
+ this.experimentId = null;
+ }
+
+ /** Returns true if field experimentId is set (has been assigned a value) and false otherwise */
+ public boolean isSetExperimentId() {
+ return this.experimentId != null;
+ }
+
+ public void setExperimentIdIsSet(boolean value) {
+ if (!value) {
+ this.experimentId = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case JOB_ID:
+ if (value == null) {
+ unsetJobId();
+ } else {
+ setJobId((String)value);
+ }
+ break;
+
+ case TASK_ID:
+ if (value == null) {
+ unsetTaskId();
+ } else {
+ setTaskId((String)value);
+ }
+ break;
+
+ case WORKFLOW_NODE_ID:
+ if (value == null) {
+ unsetWorkflowNodeId();
+ } else {
+ setWorkflowNodeId((String)value);
+ }
+ break;
+
+ case EXPERIMENT_ID:
+ if (value == null) {
+ unsetExperimentId();
+ } else {
+ setExperimentId((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case JOB_ID:
+ return getJobId();
+
+ case TASK_ID:
+ return getTaskId();
+
+ case WORKFLOW_NODE_ID:
+ return getWorkflowNodeId();
+
+ case EXPERIMENT_ID:
+ return getExperimentId();
+
+ }
+ 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_ID:
+ return isSetJobId();
+ case TASK_ID:
+ return isSetTaskId();
+ case WORKFLOW_NODE_ID:
+ return isSetWorkflowNodeId();
+ case EXPERIMENT_ID:
+ return isSetExperimentId();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof JobIdentity)
+ return this.equals((JobIdentity)that);
+ return false;
+ }
+
+ public boolean equals(JobIdentity that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_jobId = true && this.isSetJobId();
+ boolean that_present_jobId = true && that.isSetJobId();
+ if (this_present_jobId || that_present_jobId) {
+ if (!(this_present_jobId && that_present_jobId))
+ return false;
+ if (!this.jobId.equals(that.jobId))
+ return false;
+ }
+
+ boolean this_present_taskId = true && this.isSetTaskId();
+ boolean that_present_taskId = true && that.isSetTaskId();
+ if (this_present_taskId || that_present_taskId) {
+ if (!(this_present_taskId && that_present_taskId))
+ return false;
+ if (!this.taskId.equals(that.taskId))
+ return false;
+ }
+
+ boolean this_present_workflowNodeId = true && this.isSetWorkflowNodeId();
+ boolean that_present_workflowNodeId = true && that.isSetWorkflowNodeId();
+ if (this_present_workflowNodeId || that_present_workflowNodeId) {
+ if (!(this_present_workflowNodeId && that_present_workflowNodeId))
+ return false;
+ if (!this.workflowNodeId.equals(that.workflowNodeId))
+ return false;
+ }
+
+ boolean this_present_experimentId = true && this.isSetExperimentId();
+ boolean that_present_experimentId = true && that.isSetExperimentId();
+ if (this_present_experimentId || that_present_experimentId) {
+ if (!(this_present_experimentId && that_present_experimentId))
+ return false;
+ if (!this.experimentId.equals(that.experimentId))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(JobIdentity other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetJobId()).compareTo(other.isSetJobId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetJobId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jobId, other.jobId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetTaskId()).compareTo(other.isSetTaskId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetTaskId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskId, other.taskId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetWorkflowNodeId()).compareTo(other.isSetWorkflowNodeId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetWorkflowNodeId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workflowNodeId, other.workflowNodeId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetExperimentId()).compareTo(other.isSetExperimentId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetExperimentId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.experimentId, other.experimentId);
+ 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("JobIdentity(");
+ boolean first = true;
+
+ sb.append("jobId:");
+ if (this.jobId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.jobId);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("taskId:");
+ if (this.taskId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.taskId);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("workflowNodeId:");
+ if (this.workflowNodeId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.workflowNodeId);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("experimentId:");
+ if (this.experimentId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.experimentId);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (!isSetJobId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'jobId' is unset! Struct:" + toString());
+ }
+
+ if (!isSetTaskId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'taskId' is unset! Struct:" + toString());
+ }
+
+ if (!isSetWorkflowNodeId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'workflowNodeId' is unset! Struct:" + toString());
+ }
+
+ if (!isSetExperimentId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'experimentId' is unset! Struct:" + toString());
+ }
+
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ 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 JobIdentityStandardSchemeFactory implements SchemeFactory {
+ public JobIdentityStandardScheme getScheme() {
+ return new JobIdentityStandardScheme();
+ }
+ }
+
+ private static class JobIdentityStandardScheme extends StandardScheme<JobIdentity> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, JobIdentity 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_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.jobId = iprot.readString();
+ struct.setJobIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // TASK_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.taskId = iprot.readString();
+ struct.setTaskIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // WORKFLOW_NODE_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.workflowNodeId = iprot.readString();
+ struct.setWorkflowNodeIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // EXPERIMENT_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.experimentId = iprot.readString();
+ struct.setExperimentIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, JobIdentity struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.jobId != null) {
+ oprot.writeFieldBegin(JOB_ID_FIELD_DESC);
+ oprot.writeString(struct.jobId);
+ oprot.writeFieldEnd();
+ }
+ if (struct.taskId != null) {
+ oprot.writeFieldBegin(TASK_ID_FIELD_DESC);
+ oprot.writeString(struct.taskId);
+ oprot.writeFieldEnd();
+ }
+ if (struct.workflowNodeId != null) {
+ oprot.writeFieldBegin(WORKFLOW_NODE_ID_FIELD_DESC);
+ oprot.writeString(struct.workflowNodeId);
+ oprot.writeFieldEnd();
+ }
+ if (struct.experimentId != null) {
+ oprot.writeFieldBegin(EXPERIMENT_ID_FIELD_DESC);
+ oprot.writeString(struct.experimentId);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class JobIdentityTupleSchemeFactory implements SchemeFactory {
+ public JobIdentityTupleScheme getScheme() {
+ return new JobIdentityTupleScheme();
+ }
+ }
+
+ private static class JobIdentityTupleScheme extends TupleScheme<JobIdentity> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, JobIdentity struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ oprot.writeString(struct.jobId);
+ oprot.writeString(struct.taskId);
+ oprot.writeString(struct.workflowNodeId);
+ oprot.writeString(struct.experimentId);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, JobIdentity struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.jobId = iprot.readString();
+ struct.setJobIdIsSet(true);
+ struct.taskId = iprot.readString();
+ struct.setTaskIdIsSet(true);
+ struct.workflowNodeId = iprot.readString();
+ struct.setWorkflowNodeIdIsSet(true);
+ struct.experimentId = iprot.readString();
+ struct.setExperimentIdIsSet(true);
+ }
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/airavata/blob/1fe3d1d8/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobMonitor.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobMonitor.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobMonitor.java
new file mode 100644
index 0000000..f92c7bb
--- /dev/null
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobMonitor.java
@@ -0,0 +1,1043 @@
+/**
+ * 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.model.messaging.event;
+
+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;
+
+@SuppressWarnings("all") public class JobMonitor implements org.apache.thrift.TBase<JobMonitor, JobMonitor._Fields>, java.io.Serializable, Cloneable, Comparable<JobMonitor> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JobMonitor");
+
+ private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField JOB_STARTED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("jobStartedTime", org.apache.thrift.protocol.TType.I64, (short)2);
+ private static final org.apache.thrift.protocol.TField LAST_MONITORED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastMonitoredTime", org.apache.thrift.protocol.TType.I64, (short)3);
+ 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)4);
+ private static final org.apache.thrift.protocol.TField PARAMETERS_FIELD_DESC = new org.apache.thrift.protocol.TField("parameters", org.apache.thrift.protocol.TType.MAP, (short)5);
+ private static final org.apache.thrift.protocol.TField JOB_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("jobName", org.apache.thrift.protocol.TType.STRING, (short)6);
+ private static final org.apache.thrift.protocol.TField FAILED_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("failedCount", 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 JobMonitorStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new JobMonitorTupleSchemeFactory());
+ }
+
+ private String username; // optional
+ private long jobStartedTime; // optional
+ private long lastMonitoredTime; // optional
+ private String hostId; // optional
+ private Map<String,String> parameters; // optional
+ private String jobName; // optional
+ private int failedCount; // optional
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ USERNAME((short)1, "username"),
+ JOB_STARTED_TIME((short)2, "jobStartedTime"),
+ LAST_MONITORED_TIME((short)3, "lastMonitoredTime"),
+ HOST_ID((short)4, "hostId"),
+ PARAMETERS((short)5, "parameters"),
+ JOB_NAME((short)6, "jobName"),
+ FAILED_COUNT((short)7, "failedCount");
+
+ 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: // USERNAME
+ return USERNAME;
+ case 2: // JOB_STARTED_TIME
+ return JOB_STARTED_TIME;
+ case 3: // LAST_MONITORED_TIME
+ return LAST_MONITORED_TIME;
+ case 4: // HOST_ID
+ return HOST_ID;
+ case 5: // PARAMETERS
+ return PARAMETERS;
+ case 6: // JOB_NAME
+ return JOB_NAME;
+ case 7: // FAILED_COUNT
+ return FAILED_COUNT;
+ 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 __JOBSTARTEDTIME_ISSET_ID = 0;
+ private static final int __LASTMONITOREDTIME_ISSET_ID = 1;
+ private static final int __FAILEDCOUNT_ISSET_ID = 2;
+ private byte __isset_bitfield = 0;
+ private _Fields optionals[] = {_Fields.USERNAME,_Fields.JOB_STARTED_TIME,_Fields.LAST_MONITORED_TIME,_Fields.HOST_ID,_Fields.PARAMETERS,_Fields.JOB_NAME,_Fields.FAILED_COUNT};
+ 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.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.JOB_STARTED_TIME, new org.apache.thrift.meta_data.FieldMetaData("jobStartedTime", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+ tmpMap.put(_Fields.LAST_MONITORED_TIME, new org.apache.thrift.meta_data.FieldMetaData("lastMonitoredTime", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+ 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.PARAMETERS, new org.apache.thrift.meta_data.FieldMetaData("parameters", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
+ tmpMap.put(_Fields.JOB_NAME, new org.apache.thrift.meta_data.FieldMetaData("jobName", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.FAILED_COUNT, new org.apache.thrift.meta_data.FieldMetaData("failedCount", 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(JobMonitor.class, metaDataMap);
+ }
+
+ public JobMonitor() {
+ this.failedCount = 0;
+
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public JobMonitor(JobMonitor other) {
+ __isset_bitfield = other.__isset_bitfield;
+ if (other.isSetUsername()) {
+ this.username = other.username;
+ }
+ this.jobStartedTime = other.jobStartedTime;
+ this.lastMonitoredTime = other.lastMonitoredTime;
+ if (other.isSetHostId()) {
+ this.hostId = other.hostId;
+ }
+ if (other.isSetParameters()) {
+ Map<String,String> __this__parameters = new HashMap<String,String>(other.parameters);
+ this.parameters = __this__parameters;
+ }
+ if (other.isSetJobName()) {
+ this.jobName = other.jobName;
+ }
+ this.failedCount = other.failedCount;
+ }
+
+ public JobMonitor deepCopy() {
+ return new JobMonitor(this);
+ }
+
+ @Override
+ public void clear() {
+ this.username = null;
+ setJobStartedTimeIsSet(false);
+ this.jobStartedTime = 0;
+ setLastMonitoredTimeIsSet(false);
+ this.lastMonitoredTime = 0;
+ this.hostId = null;
+ this.parameters = null;
+ this.jobName = null;
+ this.failedCount = 0;
+
+ }
+
+ public String getUsername() {
+ return this.username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public void unsetUsername() {
+ this.username = null;
+ }
+
+ /** Returns true if field username is set (has been assigned a value) and false otherwise */
+ public boolean isSetUsername() {
+ return this.username != null;
+ }
+
+ public void setUsernameIsSet(boolean value) {
+ if (!value) {
+ this.username = null;
+ }
+ }
+
+ public long getJobStartedTime() {
+ return this.jobStartedTime;
+ }
+
+ public void setJobStartedTime(long jobStartedTime) {
+ this.jobStartedTime = jobStartedTime;
+ setJobStartedTimeIsSet(true);
+ }
+
+ public void unsetJobStartedTime() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JOBSTARTEDTIME_ISSET_ID);
+ }
+
+ /** Returns true if field jobStartedTime is set (has been assigned a value) and false otherwise */
+ public boolean isSetJobStartedTime() {
+ return EncodingUtils.testBit(__isset_bitfield, __JOBSTARTEDTIME_ISSET_ID);
+ }
+
+ public void setJobStartedTimeIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JOBSTARTEDTIME_ISSET_ID, value);
+ }
+
+ public long getLastMonitoredTime() {
+ return this.lastMonitoredTime;
+ }
+
+ public void setLastMonitoredTime(long lastMonitoredTime) {
+ this.lastMonitoredTime = lastMonitoredTime;
+ setLastMonitoredTimeIsSet(true);
+ }
+
+ public void unsetLastMonitoredTime() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LASTMONITOREDTIME_ISSET_ID);
+ }
+
+ /** Returns true if field lastMonitoredTime is set (has been assigned a value) and false otherwise */
+ public boolean isSetLastMonitoredTime() {
+ return EncodingUtils.testBit(__isset_bitfield, __LASTMONITOREDTIME_ISSET_ID);
+ }
+
+ public void setLastMonitoredTimeIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LASTMONITOREDTIME_ISSET_ID, value);
+ }
+
+ public String getHostId() {
+ return this.hostId;
+ }
+
+ public void setHostId(String hostId) {
+ this.hostId = hostId;
+ }
+
+ 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 int getParametersSize() {
+ return (this.parameters == null) ? 0 : this.parameters.size();
+ }
+
+ public void putToParameters(String key, String val) {
+ if (this.parameters == null) {
+ this.parameters = new HashMap<String,String>();
+ }
+ this.parameters.put(key, val);
+ }
+
+ public Map<String,String> getParameters() {
+ return this.parameters;
+ }
+
+ public void setParameters(Map<String,String> parameters) {
+ this.parameters = parameters;
+ }
+
+ public void unsetParameters() {
+ this.parameters = null;
+ }
+
+ /** Returns true if field parameters is set (has been assigned a value) and false otherwise */
+ public boolean isSetParameters() {
+ return this.parameters != null;
+ }
+
+ public void setParametersIsSet(boolean value) {
+ if (!value) {
+ this.parameters = null;
+ }
+ }
+
+ public String getJobName() {
+ return this.jobName;
+ }
+
+ public void setJobName(String jobName) {
+ this.jobName = jobName;
+ }
+
+ public void unsetJobName() {
+ this.jobName = null;
+ }
+
+ /** Returns true if field jobName is set (has been assigned a value) and false otherwise */
+ public boolean isSetJobName() {
+ return this.jobName != null;
+ }
+
+ public void setJobNameIsSet(boolean value) {
+ if (!value) {
+ this.jobName = null;
+ }
+ }
+
+ public int getFailedCount() {
+ return this.failedCount;
+ }
+
+ public void setFailedCount(int failedCount) {
+ this.failedCount = failedCount;
+ setFailedCountIsSet(true);
+ }
+
+ public void unsetFailedCount() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FAILEDCOUNT_ISSET_ID);
+ }
+
+ /** Returns true if field failedCount is set (has been assigned a value) and false otherwise */
+ public boolean isSetFailedCount() {
+ return EncodingUtils.testBit(__isset_bitfield, __FAILEDCOUNT_ISSET_ID);
+ }
+
+ public void setFailedCountIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FAILEDCOUNT_ISSET_ID, value);
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case USERNAME:
+ if (value == null) {
+ unsetUsername();
+ } else {
+ setUsername((String)value);
+ }
+ break;
+
+ case JOB_STARTED_TIME:
+ if (value == null) {
+ unsetJobStartedTime();
+ } else {
+ setJobStartedTime((Long)value);
+ }
+ break;
+
+ case LAST_MONITORED_TIME:
+ if (value == null) {
+ unsetLastMonitoredTime();
+ } else {
+ setLastMonitoredTime((Long)value);
+ }
+ break;
+
+ case HOST_ID:
+ if (value == null) {
+ unsetHostId();
+ } else {
+ setHostId((String)value);
+ }
+ break;
+
+ case PARAMETERS:
+ if (value == null) {
+ unsetParameters();
+ } else {
+ setParameters((Map<String,String>)value);
+ }
+ break;
+
+ case JOB_NAME:
+ if (value == null) {
+ unsetJobName();
+ } else {
+ setJobName((String)value);
+ }
+ break;
+
+ case FAILED_COUNT:
+ if (value == null) {
+ unsetFailedCount();
+ } else {
+ setFailedCount((Integer)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case USERNAME:
+ return getUsername();
+
+ case JOB_STARTED_TIME:
+ return Long.valueOf(getJobStartedTime());
+
+ case LAST_MONITORED_TIME:
+ return Long.valueOf(getLastMonitoredTime());
+
+ case HOST_ID:
+ return getHostId();
+
+ case PARAMETERS:
+ return getParameters();
+
+ case JOB_NAME:
+ return getJobName();
+
+ case FAILED_COUNT:
+ return Integer.valueOf(getFailedCount());
+
+ }
+ 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 USERNAME:
+ return isSetUsername();
+ case JOB_STARTED_TIME:
+ return isSetJobStartedTime();
+ case LAST_MONITORED_TIME:
+ return isSetLastMonitoredTime();
+ case HOST_ID:
+ return isSetHostId();
+ case PARAMETERS:
+ return isSetParameters();
+ case JOB_NAME:
+ return isSetJobName();
+ case FAILED_COUNT:
+ return isSetFailedCount();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof JobMonitor)
+ return this.equals((JobMonitor)that);
+ return false;
+ }
+
+ public boolean equals(JobMonitor that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_username = true && this.isSetUsername();
+ boolean that_present_username = true && that.isSetUsername();
+ if (this_present_username || that_present_username) {
+ if (!(this_present_username && that_present_username))
+ return false;
+ if (!this.username.equals(that.username))
+ return false;
+ }
+
+ boolean this_present_jobStartedTime = true && this.isSetJobStartedTime();
+ boolean that_present_jobStartedTime = true && that.isSetJobStartedTime();
+ if (this_present_jobStartedTime || that_present_jobStartedTime) {
+ if (!(this_present_jobStartedTime && that_present_jobStartedTime))
+ return false;
+ if (this.jobStartedTime != that.jobStartedTime)
+ return false;
+ }
+
+ boolean this_present_lastMonitoredTime = true && this.isSetLastMonitoredTime();
+ boolean that_present_lastMonitoredTime = true && that.isSetLastMonitoredTime();
+ if (this_present_lastMonitoredTime || that_present_lastMonitoredTime) {
+ if (!(this_present_lastMonitoredTime && that_present_lastMonitoredTime))
+ return false;
+ if (this.lastMonitoredTime != that.lastMonitoredTime)
+ 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_parameters = true && this.isSetParameters();
+ boolean that_present_parameters = true && that.isSetParameters();
+ if (this_present_parameters || that_present_parameters) {
+ if (!(this_present_parameters && that_present_parameters))
+ return false;
+ if (!this.parameters.equals(that.parameters))
+ return false;
+ }
+
+ boolean this_present_jobName = true && this.isSetJobName();
+ boolean that_present_jobName = true && that.isSetJobName();
+ if (this_present_jobName || that_present_jobName) {
+ if (!(this_present_jobName && that_present_jobName))
+ return false;
+ if (!this.jobName.equals(that.jobName))
+ return false;
+ }
+
+ boolean this_present_failedCount = true && this.isSetFailedCount();
+ boolean that_present_failedCount = true && that.isSetFailedCount();
+ if (this_present_failedCount || that_present_failedCount) {
+ if (!(this_present_failedCount && that_present_failedCount))
+ return false;
+ if (this.failedCount != that.failedCount)
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(JobMonitor other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetUsername()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetJobStartedTime()).compareTo(other.isSetJobStartedTime());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetJobStartedTime()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jobStartedTime, other.jobStartedTime);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetLastMonitoredTime()).compareTo(other.isSetLastMonitoredTime());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetLastMonitoredTime()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastMonitoredTime, other.lastMonitoredTime);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ 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(isSetParameters()).compareTo(other.isSetParameters());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetParameters()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parameters, other.parameters);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetJobName()).compareTo(other.isSetJobName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetJobName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jobName, other.jobName);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetFailedCount()).compareTo(other.isSetFailedCount());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetFailedCount()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failedCount, other.failedCount);
+ 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("JobMonitor(");
+ boolean first = true;
+
+ if (isSetUsername()) {
+ sb.append("username:");
+ if (this.username == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.username);
+ }
+ first = false;
+ }
+ if (isSetJobStartedTime()) {
+ if (!first) sb.append(", ");
+ sb.append("jobStartedTime:");
+ sb.append(this.jobStartedTime);
+ first = false;
+ }
+ if (isSetLastMonitoredTime()) {
+ if (!first) sb.append(", ");
+ sb.append("lastMonitoredTime:");
+ sb.append(this.lastMonitoredTime);
+ first = false;
+ }
+ if (isSetHostId()) {
+ if (!first) sb.append(", ");
+ sb.append("hostId:");
+ if (this.hostId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.hostId);
+ }
+ first = false;
+ }
+ if (isSetParameters()) {
+ if (!first) sb.append(", ");
+ sb.append("parameters:");
+ if (this.parameters == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.parameters);
+ }
+ first = false;
+ }
+ if (isSetJobName()) {
+ if (!first) sb.append(", ");
+ sb.append("jobName:");
+ if (this.jobName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.jobName);
+ }
+ first = false;
+ }
+ if (isSetFailedCount()) {
+ if (!first) sb.append(", ");
+ sb.append("failedCount:");
+ sb.append(this.failedCount);
+ 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 JobMonitorStandardSchemeFactory implements SchemeFactory {
+ public JobMonitorStandardScheme getScheme() {
+ return new JobMonitorStandardScheme();
+ }
+ }
+
+ private static class JobMonitorStandardScheme extends StandardScheme<JobMonitor> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, JobMonitor 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: // USERNAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.username = iprot.readString();
+ struct.setUsernameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // JOB_STARTED_TIME
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.jobStartedTime = iprot.readI64();
+ struct.setJobStartedTimeIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // LAST_MONITORED_TIME
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.lastMonitoredTime = iprot.readI64();
+ struct.setLastMonitoredTimeIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // 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 5: // PARAMETERS
+ if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
+ {
+ org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin();
+ struct.parameters = new HashMap<String,String>(2*_map0.size);
+ for (int _i1 = 0; _i1 < _map0.size; ++_i1)
+ {
+ String _key2;
+ String _val3;
+ _key2 = iprot.readString();
+ _val3 = iprot.readString();
+ struct.parameters.put(_key2, _val3);
+ }
+ iprot.readMapEnd();
+ }
+ struct.setParametersIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 6: // JOB_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.jobName = iprot.readString();
+ struct.setJobNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 7: // FAILED_COUNT
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.failedCount = iprot.readI32();
+ struct.setFailedCountIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, JobMonitor struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.username != null) {
+ if (struct.isSetUsername()) {
+ oprot.writeFieldBegin(USERNAME_FIELD_DESC);
+ oprot.writeString(struct.username);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.isSetJobStartedTime()) {
+ oprot.writeFieldBegin(JOB_STARTED_TIME_FIELD_DESC);
+ oprot.writeI64(struct.jobStartedTime);
+ oprot.writeFieldEnd();
+ }
+ if (struct.isSetLastMonitoredTime()) {
+ oprot.writeFieldBegin(LAST_MONITORED_TIME_FIELD_DESC);
+ oprot.writeI64(struct.lastMonitoredTime);
+ oprot.writeFieldEnd();
+ }
+ if (struct.hostId != null) {
+ if (struct.isSetHostId()) {
+ oprot.writeFieldBegin(HOST_ID_FIELD_DESC);
+ oprot.writeString(struct.hostId);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.parameters != null) {
+ if (struct.isSetParameters()) {
+ oprot.writeFieldBegin(PARAMETERS_FIELD_DESC);
+ {
+ oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.parameters.size()));
+ for (Map.Entry<String, String> _iter4 : struct.parameters.entrySet())
+ {
+ oprot.writeString(_iter4.getKey());
+ oprot.writeString(_iter4.getValue());
+ }
+ oprot.writeMapEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.jobName != null) {
+ if (struct.isSetJobName()) {
+ oprot.writeFieldBegin(JOB_NAME_FIELD_DESC);
+ oprot.writeString(struct.jobName);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.isSetFailedCount()) {
+ oprot.writeFieldBegin(FAILED_COUNT_FIELD_DESC);
+ oprot.writeI32(struct.failedCount);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class JobMonitorTupleSchemeFactory implements SchemeFactory {
+ public JobMonitorTupleScheme getScheme() {
+ return new JobMonitorTupleScheme();
+ }
+ }
+
+ private static class JobMonitorTupleScheme extends TupleScheme<JobMonitor> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, JobMonitor struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetUsername()) {
+ optionals.set(0);
+ }
+ if (struct.isSetJobStartedTime()) {
+ optionals.set(1);
+ }
+ if (struct.isSetLastMonitoredTime()) {
+ optionals.set(2);
+ }
+ if (struct.isSetHostId()) {
+ optionals.set(3);
+ }
+ if (struct.isSetParameters()) {
+ optionals.set(4);
+ }
+ if (struct.isSetJobName()) {
+ optionals.set(5);
+ }
+ if (struct.isSetFailedCount()) {
+ optionals.set(6);
+ }
+ oprot.writeBitSet(optionals, 7);
+ if (struct.isSetUsername()) {
+ oprot.writeString(struct.username);
+ }
+ if (struct.isSetJobStartedTime()) {
+ oprot.writeI64(struct.jobStartedTime);
+ }
+ if (struct.isSetLastMonitoredTime()) {
+ oprot.writeI64(struct.lastMonitoredTime);
+ }
+ if (struct.isSetHostId()) {
+ oprot.writeString(struct.hostId);
+ }
+ if (struct.isSetParameters()) {
+ {
+ oprot.writeI32(struct.parameters.size());
+ for (Map.Entry<String, String> _iter5 : struct.parameters.entrySet())
+ {
+ oprot.writeString(_iter5.getKey());
+ oprot.writeString(_iter5.getValue());
+ }
+ }
+ }
+ if (struct.isSetJobName()) {
+ oprot.writeString(struct.jobName);
+ }
+ if (struct.isSetFailedCount()) {
+ oprot.writeI32(struct.failedCount);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, JobMonitor struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(7);
+ if (incoming.get(0)) {
+ struct.username = iprot.readString();
+ struct.setUsernameIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.jobStartedTime = iprot.readI64();
+ struct.setJobStartedTimeIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.lastMonitoredTime = iprot.readI64();
+ struct.setLastMonitoredTimeIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.hostId = iprot.readString();
+ struct.setHostIdIsSet(true);
+ }
+ if (incoming.get(4)) {
+ {
+ org.apache.thrift.protocol.TMap _map6 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.parameters = new HashMap<String,String>(2*_map6.size);
+ for (int _i7 = 0; _i7 < _map6.size; ++_i7)
+ {
+ String _key8;
+ String _val9;
+ _key8 = iprot.readString();
+ _val9 = iprot.readString();
+ struct.parameters.put(_key8, _val9);
+ }
+ }
+ struct.setParametersIsSet(true);
+ }
+ if (incoming.get(5)) {
+ struct.jobName = iprot.readString();
+ struct.setJobNameIsSet(true);
+ }
+ if (incoming.get(6)) {
+ struct.failedCount = iprot.readI32();
+ struct.setFailedCountIsSet(true);
+ }
+ }
+ }
+
+}
+