You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2014/07/23 20:23:30 UTC
[6/7] git commit: adding new field for jobDetails object
adding new field for jobDetails object
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/4ae0104b
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/4ae0104b
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/4ae0104b
Branch: refs/heads/master
Commit: 4ae0104b2809f514c1309ed9f96378e1935436eb
Parents: c61d438
Author: lahiru <la...@apache.org>
Authored: Wed Jul 23 14:21:26 2014 -0400
Committer: lahiru <la...@apache.org>
Committed: Wed Jul 23 14:21:26 2014 -0400
----------------------------------------------------------------------
.../model/workspace/experiment/JobDetails.java | 109 ++++++++++++++++++-
.../experimentModel.thrift | 3 +-
2 files changed, 107 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/4ae0104b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/JobDetails.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/JobDetails.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/JobDetails.java
index 92d0d60..d1cbe5e 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/JobDetails.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/workspace/experiment/JobDetails.java
@@ -59,6 +59,7 @@ import org.slf4j.LoggerFactory;
private static final org.apache.thrift.protocol.TField APPLICATION_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationStatus", org.apache.thrift.protocol.TType.STRUCT, (short)5);
private static final org.apache.thrift.protocol.TField ERRORS_FIELD_DESC = new org.apache.thrift.protocol.TField("errors", org.apache.thrift.protocol.TType.LIST, (short)6);
private static final org.apache.thrift.protocol.TField COMPUTE_RESOURCE_CONSUMED_FIELD_DESC = new org.apache.thrift.protocol.TField("computeResourceConsumed", org.apache.thrift.protocol.TType.STRING, (short)7);
+ 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)8);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -73,6 +74,7 @@ import org.slf4j.LoggerFactory;
private ApplicationStatus applicationStatus; // optional
private List<ErrorDetails> errors; // optional
private String computeResourceConsumed; // optional
+ private String jobName; // 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 {
@@ -82,7 +84,8 @@ import org.slf4j.LoggerFactory;
JOB_STATUS((short)4, "jobStatus"),
APPLICATION_STATUS((short)5, "applicationStatus"),
ERRORS((short)6, "errors"),
- COMPUTE_RESOURCE_CONSUMED((short)7, "computeResourceConsumed");
+ COMPUTE_RESOURCE_CONSUMED((short)7, "computeResourceConsumed"),
+ JOB_NAME((short)8, "jobName");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -111,6 +114,8 @@ import org.slf4j.LoggerFactory;
return ERRORS;
case 7: // COMPUTE_RESOURCE_CONSUMED
return COMPUTE_RESOURCE_CONSUMED;
+ case 8: // JOB_NAME
+ return JOB_NAME;
default:
return null;
}
@@ -153,7 +158,7 @@ import org.slf4j.LoggerFactory;
// isset id assignments
private static final int __CREATIONTIME_ISSET_ID = 0;
private byte __isset_bitfield = 0;
- private _Fields optionals[] = {_Fields.CREATION_TIME,_Fields.JOB_STATUS,_Fields.APPLICATION_STATUS,_Fields.ERRORS,_Fields.COMPUTE_RESOURCE_CONSUMED};
+ private _Fields optionals[] = {_Fields.CREATION_TIME,_Fields.JOB_STATUS,_Fields.APPLICATION_STATUS,_Fields.ERRORS,_Fields.COMPUTE_RESOURCE_CONSUMED,_Fields.JOB_NAME};
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);
@@ -172,6 +177,8 @@ import org.slf4j.LoggerFactory;
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ErrorDetails.class))));
tmpMap.put(_Fields.COMPUTE_RESOURCE_CONSUMED, new org.apache.thrift.meta_data.FieldMetaData("computeResourceConsumed", org.apache.thrift.TFieldRequirementType.OPTIONAL,
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)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JobDetails.class, metaDataMap);
}
@@ -218,6 +225,9 @@ import org.slf4j.LoggerFactory;
if (other.isSetComputeResourceConsumed()) {
this.computeResourceConsumed = other.computeResourceConsumed;
}
+ if (other.isSetJobName()) {
+ this.jobName = other.jobName;
+ }
}
public JobDetails deepCopy() {
@@ -235,6 +245,7 @@ import org.slf4j.LoggerFactory;
this.applicationStatus = null;
this.errors = null;
this.computeResourceConsumed = null;
+ this.jobName = null;
}
public String getJobID() {
@@ -412,6 +423,29 @@ import org.slf4j.LoggerFactory;
}
}
+ 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 void setFieldValue(_Fields field, Object value) {
switch (field) {
case JOB_ID:
@@ -470,6 +504,14 @@ import org.slf4j.LoggerFactory;
}
break;
+ case JOB_NAME:
+ if (value == null) {
+ unsetJobName();
+ } else {
+ setJobName((String)value);
+ }
+ break;
+
}
}
@@ -496,6 +538,9 @@ import org.slf4j.LoggerFactory;
case COMPUTE_RESOURCE_CONSUMED:
return getComputeResourceConsumed();
+ case JOB_NAME:
+ return getJobName();
+
}
throw new IllegalStateException();
}
@@ -521,6 +566,8 @@ import org.slf4j.LoggerFactory;
return isSetErrors();
case COMPUTE_RESOURCE_CONSUMED:
return isSetComputeResourceConsumed();
+ case JOB_NAME:
+ return isSetJobName();
}
throw new IllegalStateException();
}
@@ -601,6 +648,15 @@ import org.slf4j.LoggerFactory;
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;
+ }
+
return true;
}
@@ -687,6 +743,16 @@ import org.slf4j.LoggerFactory;
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;
+ }
+ }
return 0;
}
@@ -768,6 +834,16 @@ import org.slf4j.LoggerFactory;
}
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;
+ }
sb.append(")");
return sb.toString();
}
@@ -896,6 +972,14 @@ import org.slf4j.LoggerFactory;
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 8: // 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;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -959,6 +1043,13 @@ import org.slf4j.LoggerFactory;
oprot.writeFieldEnd();
}
}
+ if (struct.jobName != null) {
+ if (struct.isSetJobName()) {
+ oprot.writeFieldBegin(JOB_NAME_FIELD_DESC);
+ oprot.writeString(struct.jobName);
+ oprot.writeFieldEnd();
+ }
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -994,7 +1085,10 @@ import org.slf4j.LoggerFactory;
if (struct.isSetComputeResourceConsumed()) {
optionals.set(4);
}
- oprot.writeBitSet(optionals, 5);
+ if (struct.isSetJobName()) {
+ optionals.set(5);
+ }
+ oprot.writeBitSet(optionals, 6);
if (struct.isSetCreationTime()) {
oprot.writeI64(struct.creationTime);
}
@@ -1016,6 +1110,9 @@ import org.slf4j.LoggerFactory;
if (struct.isSetComputeResourceConsumed()) {
oprot.writeString(struct.computeResourceConsumed);
}
+ if (struct.isSetJobName()) {
+ oprot.writeString(struct.jobName);
+ }
}
@Override
@@ -1025,7 +1122,7 @@ import org.slf4j.LoggerFactory;
struct.setJobIDIsSet(true);
struct.jobDescription = iprot.readString();
struct.setJobDescriptionIsSet(true);
- BitSet incoming = iprot.readBitSet(5);
+ BitSet incoming = iprot.readBitSet(6);
if (incoming.get(0)) {
struct.creationTime = iprot.readI64();
struct.setCreationTimeIsSet(true);
@@ -1058,6 +1155,10 @@ import org.slf4j.LoggerFactory;
struct.computeResourceConsumed = iprot.readString();
struct.setComputeResourceConsumedIsSet(true);
}
+ if (incoming.get(5)) {
+ struct.jobName = iprot.readString();
+ struct.setJobNameIsSet(true);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/4ae0104b/airavata-api/thrift-interface-descriptions/experimentModel.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/experimentModel.thrift b/airavata-api/thrift-interface-descriptions/experimentModel.thrift
index 5338d2b..75a900f 100644
--- a/airavata-api/thrift-interface-descriptions/experimentModel.thrift
+++ b/airavata-api/thrift-interface-descriptions/experimentModel.thrift
@@ -283,7 +283,8 @@ struct JobDetails {
4: optional JobStatus jobStatus,
5: optional ApplicationStatus applicationStatus,
6: optional list<ErrorDetails> errors,
- 7: optional string computeResourceConsumed
+ 7: optional string computeResourceConsumed,
+ 8: optional string jobName
}
struct DataTransferDetails {