You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2014/02/18 22:43:44 UTC
git commit: Adding a resource usage field for the Job Details Object
- AIRAVATA-1017
Repository: airavata
Updated Branches:
refs/heads/master af9cd3b38 -> b66eba943
Adding a resource usage field for the Job Details Object - AIRAVATA-1017
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/b66eba94
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/b66eba94
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/b66eba94
Branch: refs/heads/master
Commit: b66eba9439a9cde42d1c22dadec9119247be1c34
Parents: af9cd3b
Author: Suresh Marru <sm...@apache.org>
Authored: Tue Feb 18 16:43:38 2014 -0500
Committer: Suresh Marru <sm...@apache.org>
Committed: Tue Feb 18 16:43:38 2014 -0500
----------------------------------------------------------------------
.../handler/MockAiravataServerHandler.java | 214 +++++++++++++++++++
.../model/workspace/experiment/JobDetails.java | 109 +++++++++-
.../model/util/ExperimentModelUtil.java | 105 ++++-----
airavata-api/pom.xml | 1 +
.../experimentModel.thrift | 3 +-
5 files changed, 364 insertions(+), 68 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/b66eba94/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/MockAiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/MockAiravataServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/MockAiravataServerHandler.java
index b63b806..95838de 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/MockAiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/MockAiravataServerHandler.java
@@ -29,6 +29,8 @@ import org.apache.airavata.api.error.ExperimentNotFoundException;
import org.apache.airavata.api.error.InvalidRequestException;
import org.apache.airavata.model.experiment.BasicMetadata;
import org.apache.airavata.model.experiment.ConfigurationData;
+import org.apache.airavata.model.workspace.experiment.Experiment;
+import org.apache.airavata.model.workspace.experiment.ExperimentStatus;
import org.apache.thrift.TException;
import java.util.UUID;
@@ -48,6 +50,213 @@ public class MockAiravataServerHandler implements Airavata.Iface{
* has to subsequently configure and launch the created experiment. No action is taken on Airavata Server except
* registering the experiment in a persistent store.
*
+ * @param experiment@return The server-side generated airavata experiment globally unique identifier.
+ * @throws org.apache.airavata.api.error.InvalidRequestException For any incorrect forming of the request itself.
+ * @throws org.apache.airavata.api.error.AiravataClientException The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+ * <p/>
+ * UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+ * step, then Airavata Registry will not have a provenance area setup. The client has to follow
+ * gateway registration steps and retry this request.
+ * <p/>
+ * AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+ * For now this is a place holder.
+ * <p/>
+ * INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+ * is implemented, the authorization will be more substantial.
+ * @throws org.apache.airavata.api.error.AiravataSystemException This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+ * rather an Airavata Administrator will be notified to take corrective action.
+ */
+ @Override
+ public String createExperiment(Experiment experiment) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
+ return null;
+ }
+
+ /**
+ * Fetch previously created experiment metadata.
+ *
+ * @param airavataExperimentId The identifier for the requested experiment. This is returned during the create experiment step.
+ * @return experimentMetada
+ * This method will return the previously stored experiment metadata.
+ * @throws org.apache.airavata.api.error.InvalidRequestException For any incorrect forming of the request itself.
+ * @throws org.apache.airavata.api.error.ExperimentNotFoundException If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
+ * @throws org.apache.airavata.api.error.AiravataClientException The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+ * <p/>
+ * UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+ * step, then Airavata Registry will not have a provenance area setup. The client has to follow
+ * gateway registration steps and retry this request.
+ * <p/>
+ * AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+ * For now this is a place holder.
+ * <p/>
+ * INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+ * is implemented, the authorization will be more substantial.
+ * @throws org.apache.airavata.api.error.AiravataSystemException This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+ * rather an Airavata Administrator will be notified to take corrective action.
+ */
+ @Override
+ public Experiment getBasicExperiment(String airavataExperimentId) throws InvalidRequestException, ExperimentNotFoundException, AiravataClientException, AiravataSystemException, TException {
+ return null;
+ }
+
+ /**
+ * Configure a previously created experiment with required inputs, scheduling and other quality of service
+ * parameters. This method only updates the experiment object within the registry. The experiment has to be launched
+ * to make it actionable by the server.
+ *
+ * @param airavataExperimentId The identifier for the requested experiment. This is returned during the create experiment step.
+ * @param experiment
+ * @return This method call does not have a return value.
+ * @throws org.apache.airavata.api.error.InvalidRequestException For any incorrect forming of the request itself.
+ * @throws org.apache.airavata.api.error.ExperimentNotFoundException If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
+ * @throws org.apache.airavata.api.error.AiravataClientException The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+ * <p/>
+ * UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+ * step, then Airavata Registry will not have a provenance area setup. The client has to follow
+ * gateway registration steps and retry this request.
+ * <p/>
+ * AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+ * For now this is a place holder.
+ * <p/>
+ * INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+ * is implemented, the authorization will be more substantial.
+ * @throws org.apache.airavata.api.error.AiravataSystemException This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+ * rather an Airavata Administrator will be notified to take corrective action.
+ */
+ @Override
+ public void updateExperiment(String airavataExperimentId, Experiment experiment) throws InvalidRequestException, ExperimentNotFoundException, AiravataClientException, AiravataSystemException, TException {
+
+ }
+
+ /**
+ * Fetch the previously configured experiment configuration information.
+ *
+ * @param airavataExperimentId The identifier for the requested experiment. This is returned during the create experiment step.
+ * @return This method returns the previously configured experiment configuration data.
+ * @throws org.apache.airavata.api.error.InvalidRequestException For any incorrect forming of the request itself.
+ * @throws org.apache.airavata.api.error.ExperimentNotFoundException If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
+ * @throws org.apache.airavata.api.error.AiravataClientException The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+ * <p/>
+ * UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+ * step, then Airavata Registry will not have a provenance area setup. The client has to follow
+ * gateway registration steps and retry this request.
+ * <p/>
+ * AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+ * For now this is a place holder.
+ * <p/>
+ * INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+ * is implemented, the authorization will be more substantial.
+ * @throws org.apache.airavata.api.error.AiravataSystemException This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+ * rather an Airavata Administrator will be notified to take corrective action.
+ */
+ @Override
+ public ExperimentStatus getExperimentStatus(String airavataExperimentId) throws InvalidRequestException, ExperimentNotFoundException, AiravataClientException, AiravataSystemException, TException {
+ return null;
+ }
+
+ /**
+ * Launch a previously created and configured experiment. Airavata Server will then start processing the request and appropriate
+ * notifications and intermediate and output data will be subsequently available for this experiment.
+ *
+ * @param airavataExperimentId The identifier for the requested experiment. This is returned during the create experiment step.
+ * @param airavataCredStoreToken :
+ * A requirement to execute experiments within Airavata is to first register the targeted remote computational account
+ * credentials with Airavata Credential Store. The administrative API (related to credential store) will return a
+ * generated token associated with the registered credentials. The client has to security posses this token id and is
+ * required to pass it to Airavata Server for all execution requests.
+ * Note: At this point only the credential store token is required so the string is directly passed here. In future if
+ * if more security credentials are enables, then the structure ExecutionSecurityParameters should be used.
+ * Note: This parameter is not persisted within Airavata Registry for security reasons.
+ * @return This method call does not have a return value.
+ * @throws org.apache.airavata.api.error.InvalidRequestException For any incorrect forming of the request itself.
+ * @throws org.apache.airavata.api.error.ExperimentNotFoundException If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
+ * @throws org.apache.airavata.api.error.AiravataClientException The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+ * <p/>
+ * UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+ * step, then Airavata Registry will not have a provenance area setup. The client has to follow
+ * gateway registration steps and retry this request.
+ * <p/>
+ * AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+ * For now this is a place holder.
+ * <p/>
+ * INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+ * is implemented, the authorization will be more substantial.
+ * @throws org.apache.airavata.api.error.AiravataSystemException This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+ * rather an Airavata Administrator will be notified to take corrective action.
+ */
+ @Override
+ public void launchExperiment(String airavataExperimentId, String airavataCredStoreToken) throws InvalidRequestException, ExperimentNotFoundException, AiravataClientException, AiravataSystemException, TException {
+
+ }
+
+ /**
+ * Configure and Launch a previously created experiment with required inputs, scheduling, security and other quality of service
+ * parameters. This method also launches the experiment after it is configured. If you would like to configure only
+ * and launch at a later time or partially configure then ConfigureExperiment should be used.
+ *
+ * @param airavataExperimentId The identifier for the requested experiment. This is returned during the create experiment step.
+ * @param experiment
+ * @param airavataCredStoreToken :
+ * A requirement to execute experiments within Airavata is to first register the targeted remote computational account
+ * credentials with Airavata Credential Store. The administrative API (related to credential store) will return a
+ * generated token associated with the registered credentials. The client has to security posses this token id and is
+ * required to pass it to Airavata Server for all execution requests.
+ * Note: At this point only the credential store token is required so the string is directly passed here. In future if
+ * if more security credentials are enables, then the structure ExecutionSecurityParameters should be used.
+ * @return The server-side generated experiment GUID.
+ * @throws org.apache.airavata.api.error.InvalidRequestException For any incorrect forming of the request itself.
+ * @throws org.apache.airavata.api.error.AiravataClientException The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+ * <p/>
+ * UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+ * step, then Airavata Registry will not have a provenance area setup. The client has to follow
+ * gateway registration steps and retry this request.
+ * <p/>
+ * AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+ * For now this is a place holder.
+ * <p/>
+ * INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+ * is implemented, the authorization will be more substantial.
+ * @throws org.apache.airavata.api.error.AiravataSystemException This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+ * rather an Airavata Administrator will be notified to take corrective action.
+ */
+ @Override
+ public String updateAndLaunchExperiment(String airavataExperimentId, Experiment experiment, String airavataCredStoreToken) throws InvalidRequestException, ExperimentNotFoundException, AiravataClientException, AiravataSystemException, TException {
+ return null;
+ }
+
+ /**
+ * Clone an specified experiment with a new name. A copy of the experiment configuration is made and is persisted with new metadata.
+ * The client has to subsequently update this configuration if needed and launch the cloned experiment.
+ *
+ * @param airavataExperimentIdToBeCloned This is the experiment identifier that is to be cloned.
+ * @param updatedExperiment
+ * @return The server-side generated airavata experiment globally unique identifier for the newly cloned experiment.
+ * @throws org.apache.airavata.api.error.InvalidRequestException For any incorrect forming of the request itself.
+ * @throws org.apache.airavata.api.error.ExperimentNotFoundException If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
+ * @throws org.apache.airavata.api.error.AiravataClientException The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+ * <p/>
+ * UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+ * step, then Airavata Registry will not have a provenance area setup. The client has to follow
+ * gateway registration steps and retry this request.
+ * <p/>
+ * AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+ * For now this is a place holder.
+ * <p/>
+ * INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+ * is implemented, the authorization will be more substantial.
+ * @throws org.apache.airavata.api.error.AiravataSystemException This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+ * rather an Airavata Administrator will be notified to take corrective action.
+ */
+ @Override
+ public String cloneExperiment(String airavataExperimentIdToBeCloned, Experiment updatedExperiment) throws InvalidRequestException, ExperimentNotFoundException, AiravataClientException, AiravataSystemException, TException {
+ return null;
+ }
+
+ /**
+ * Create an experiment for the specified user belonging to the gateway. The gateway identity is not explicitly passed
+ * but inferred from the authentication header. This experiment is just a persistent place holder. The client
+ * has to subsequently configure and launch the created experiment. No action is taken on Airavata Server except
+ * registering the experiment in a persistent store.
+ *
* @param basicExperimentMetadata The create experiment will require the basic experiment metadata like the name and description, intended user,
* the gateway identifer and if the experiment should be shared public by defualt. During the creation of an experiment
* the ExperimentMetadata is a required field.
@@ -282,4 +491,9 @@ public class MockAiravataServerHandler implements Airavata.Iface{
public void terminateExperiment(String airavataExperimentId) throws InvalidRequestException, ExperimentNotFoundException, AiravataClientException, AiravataSystemException, TException {
}
+
+ @Override
+ public String createProject(String projectName, String userName) throws InvalidRequestException, ExperimentNotFoundException, AiravataClientException, AiravataSystemException, TException {
+ return null;
+ }
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b66eba94/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 073a580..bc790c7 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
@@ -57,6 +57,7 @@ import org.slf4j.LoggerFactory;
private static final org.apache.thrift.protocol.TField JOB_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("jobStatus", org.apache.thrift.protocol.TType.STRUCT, (short)4);
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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -70,6 +71,7 @@ import org.slf4j.LoggerFactory;
private JobStatus jobStatus; // optional
private ApplicationStatus applicationStatus; // optional
private List<ErrorDetails> errors; // optional
+ private String computeResourceConsumed; // 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 {
@@ -78,7 +80,8 @@ import org.slf4j.LoggerFactory;
CREATION_TIME((short)3, "creationTime"),
JOB_STATUS((short)4, "jobStatus"),
APPLICATION_STATUS((short)5, "applicationStatus"),
- ERRORS((short)6, "errors");
+ ERRORS((short)6, "errors"),
+ COMPUTE_RESOURCE_CONSUMED((short)7, "computeResourceConsumed");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -105,6 +108,8 @@ import org.slf4j.LoggerFactory;
return APPLICATION_STATUS;
case 6: // ERRORS
return ERRORS;
+ case 7: // COMPUTE_RESOURCE_CONSUMED
+ return COMPUTE_RESOURCE_CONSUMED;
default:
return null;
}
@@ -147,7 +152,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};
+ private _Fields optionals[] = {_Fields.CREATION_TIME,_Fields.JOB_STATUS,_Fields.APPLICATION_STATUS,_Fields.ERRORS,_Fields.COMPUTE_RESOURCE_CONSUMED};
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);
@@ -164,6 +169,8 @@ import org.slf4j.LoggerFactory;
tmpMap.put(_Fields.ERRORS, new org.apache.thrift.meta_data.FieldMetaData("errors", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
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)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JobDetails.class, metaDataMap);
}
@@ -207,6 +214,9 @@ import org.slf4j.LoggerFactory;
}
this.errors = __this__errors;
}
+ if (other.isSetComputeResourceConsumed()) {
+ this.computeResourceConsumed = other.computeResourceConsumed;
+ }
}
public JobDetails deepCopy() {
@@ -223,6 +233,7 @@ import org.slf4j.LoggerFactory;
this.jobStatus = null;
this.applicationStatus = null;
this.errors = null;
+ this.computeResourceConsumed = null;
}
public String getJobID() {
@@ -377,6 +388,29 @@ import org.slf4j.LoggerFactory;
}
}
+ public String getComputeResourceConsumed() {
+ return this.computeResourceConsumed;
+ }
+
+ public void setComputeResourceConsumed(String computeResourceConsumed) {
+ this.computeResourceConsumed = computeResourceConsumed;
+ }
+
+ public void unsetComputeResourceConsumed() {
+ this.computeResourceConsumed = null;
+ }
+
+ /** Returns true if field computeResourceConsumed is set (has been assigned a value) and false otherwise */
+ public boolean isSetComputeResourceConsumed() {
+ return this.computeResourceConsumed != null;
+ }
+
+ public void setComputeResourceConsumedIsSet(boolean value) {
+ if (!value) {
+ this.computeResourceConsumed = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case JOB_ID:
@@ -427,6 +461,14 @@ import org.slf4j.LoggerFactory;
}
break;
+ case COMPUTE_RESOURCE_CONSUMED:
+ if (value == null) {
+ unsetComputeResourceConsumed();
+ } else {
+ setComputeResourceConsumed((String)value);
+ }
+ break;
+
}
}
@@ -450,6 +492,9 @@ import org.slf4j.LoggerFactory;
case ERRORS:
return getErrors();
+ case COMPUTE_RESOURCE_CONSUMED:
+ return getComputeResourceConsumed();
+
}
throw new IllegalStateException();
}
@@ -473,6 +518,8 @@ import org.slf4j.LoggerFactory;
return isSetApplicationStatus();
case ERRORS:
return isSetErrors();
+ case COMPUTE_RESOURCE_CONSUMED:
+ return isSetComputeResourceConsumed();
}
throw new IllegalStateException();
}
@@ -544,6 +591,15 @@ import org.slf4j.LoggerFactory;
return false;
}
+ boolean this_present_computeResourceConsumed = true && this.isSetComputeResourceConsumed();
+ boolean that_present_computeResourceConsumed = true && that.isSetComputeResourceConsumed();
+ if (this_present_computeResourceConsumed || that_present_computeResourceConsumed) {
+ if (!(this_present_computeResourceConsumed && that_present_computeResourceConsumed))
+ return false;
+ if (!this.computeResourceConsumed.equals(that.computeResourceConsumed))
+ return false;
+ }
+
return true;
}
@@ -620,6 +676,16 @@ import org.slf4j.LoggerFactory;
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetComputeResourceConsumed()).compareTo(other.isSetComputeResourceConsumed());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetComputeResourceConsumed()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.computeResourceConsumed, other.computeResourceConsumed);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -691,6 +757,16 @@ import org.slf4j.LoggerFactory;
}
first = false;
}
+ if (isSetComputeResourceConsumed()) {
+ if (!first) sb.append(", ");
+ sb.append("computeResourceConsumed:");
+ if (this.computeResourceConsumed == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.computeResourceConsumed);
+ }
+ first = false;
+ }
sb.append(")");
return sb.toString();
}
@@ -811,6 +887,14 @@ import org.slf4j.LoggerFactory;
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 7: // COMPUTE_RESOURCE_CONSUMED
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.computeResourceConsumed = iprot.readString();
+ struct.setComputeResourceConsumedIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -867,6 +951,13 @@ import org.slf4j.LoggerFactory;
oprot.writeFieldEnd();
}
}
+ if (struct.computeResourceConsumed != null) {
+ if (struct.isSetComputeResourceConsumed()) {
+ oprot.writeFieldBegin(COMPUTE_RESOURCE_CONSUMED_FIELD_DESC);
+ oprot.writeString(struct.computeResourceConsumed);
+ oprot.writeFieldEnd();
+ }
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -899,7 +990,10 @@ import org.slf4j.LoggerFactory;
if (struct.isSetErrors()) {
optionals.set(3);
}
- oprot.writeBitSet(optionals, 4);
+ if (struct.isSetComputeResourceConsumed()) {
+ optionals.set(4);
+ }
+ oprot.writeBitSet(optionals, 5);
if (struct.isSetCreationTime()) {
oprot.writeI64(struct.creationTime);
}
@@ -918,6 +1012,9 @@ import org.slf4j.LoggerFactory;
}
}
}
+ if (struct.isSetComputeResourceConsumed()) {
+ oprot.writeString(struct.computeResourceConsumed);
+ }
}
@Override
@@ -927,7 +1024,7 @@ import org.slf4j.LoggerFactory;
struct.setJobIDIsSet(true);
struct.jobDescription = iprot.readString();
struct.setJobDescriptionIsSet(true);
- BitSet incoming = iprot.readBitSet(4);
+ BitSet incoming = iprot.readBitSet(5);
if (incoming.get(0)) {
struct.creationTime = iprot.readI64();
struct.setCreationTimeIsSet(true);
@@ -956,6 +1053,10 @@ import org.slf4j.LoggerFactory;
}
struct.setErrorsIsSet(true);
}
+ if (incoming.get(4)) {
+ struct.computeResourceConsumed = iprot.readString();
+ struct.setComputeResourceConsumedIsSet(true);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/b66eba94/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java b/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java
index 72eb5be..2fd64cd 100644
--- a/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java
+++ b/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java
@@ -21,102 +21,81 @@
package org.apache.airavata.model.util;
-import org.apache.airavata.model.experiment.*;
-import java.util.Map;
+import org.apache.airavata.model.workspace.experiment.*;
+
+import java.util.List;
public class ExperimentModelUtil {
- public static BasicMetadata createExperimentBasicMetadata (String experimentName,
- String expDescription,
- String userName,
- String projectID,
- boolean shareExp){
- BasicMetadata basicMetadata = new BasicMetadata();
- basicMetadata.setUserName(userName);
- basicMetadata.setExperimentDescription(expDescription);
- basicMetadata.setExperimentName(experimentName);
- basicMetadata.setProjectID(projectID);
- basicMetadata.setShareExperimentPublicly(shareExp);
- return basicMetadata;
- }
- public static ConfigurationData createConfigData (String applicationId,
- String applicationVersion,
- String workflowId,
- String workflowVersion,
- BasicMetadata basicMetadata,
- Map<String, String> experimentInputs,
- ComputationalResourceScheduling resourceScheduling,
- AdvancedInputDataHandling inputDataHandling,
- AdvancedOutputDataHandling outputDataHandling,
- QualityOfServiceParams qosParms){
- ConfigurationData configData = new ConfigurationData();
- configData.setApplicationId(applicationId);
- configData.setApplicationVersion(applicationVersion);
- configData.setWorkflowTemplateId(workflowId);
- configData.setWorklfowTemplateVersion(workflowVersion);
- configData.setBasicMetadata(basicMetadata);
- configData.setExperimentInputs(experimentInputs);
- configData.setComputationalResourceScheduling(resourceScheduling);
- configData.setAdvanceInputDataHandling(inputDataHandling);
- configData.setAdvanceOutputDataHandling(outputDataHandling);
- configData.setQosParams(qosParms);
- return configData;
+ public static Experiment createSimpleExperiment(String projectID,
+ String userName,
+ String experimentName,
+ String expDescription,
+ String applicationId,
+ List<DataObjectType> experimentInputList) {
+ Experiment experiment = new Experiment();
+ experiment.setProjectID(projectID);
+ experiment.setUserName(userName);
+ experiment.setName(experimentName);
+ experiment.setDescription(expDescription);
+ experiment.setApplicationId(applicationId);
+ experiment.setExperimentInputs(experimentInputList);
+
+ return experiment;
}
- public static ComputationalResourceScheduling createComputationResourceScheduling (boolean airavataAutoSchedule,
- boolean overrideManualSchedulingParams,
- String resourceHostId,
- int cpuCount,
- int nodeCount,
- int numberOfThreads,
- String queueName,
- int wallTimeLimit,
- long jobstartTime,
- int totalPhysicalMemory,
- String projectAccount){
+
+
+ public static ComputationalResourceScheduling createComputationResourceScheduling(String resourceHostId,
+ int cpuCount,
+ int nodeCount,
+ int numberOfThreads,
+ String queueName,
+ int wallTimeLimit,
+ long jobstartTime,
+ int totalPhysicalMemory,
+ String projectAccount) {
ComputationalResourceScheduling cmRS = new ComputationalResourceScheduling();
-// cmRS.setAiravataAutoSchedule(airavataAutoSchedule);
-// cmRS.setOverrideManualScheduledParams(overrideManualSchedulingParams);
cmRS.setResourceHostId(resourceHostId);
cmRS.setTotalCPUCount(cpuCount);
cmRS.setNodeCount(nodeCount);
cmRS.setNumberOfThreads(numberOfThreads);
cmRS.setQueueName(queueName);
cmRS.setWallTimeLimit(wallTimeLimit);
- cmRS.setJobStartTime((int)jobstartTime);
+ cmRS.setJobStartTime((int) jobstartTime);
cmRS.setTotalPhysicalMemory(totalPhysicalMemory);
cmRS.setComputationalProjectAccount(projectAccount);
return cmRS;
}
- public static AdvancedInputDataHandling createAdvancedInputHandling (boolean stageInputFilesToWorkingDir,
- String workingDirParent,
- String uniqueWorkingDir,
- boolean cleanupAfterJob){
+ public static AdvancedInputDataHandling createAdvancedInputHandling(boolean stageInputFilesToWorkingDir,
+ String parentWorkingDir,
+ String uniqueWorkingDir,
+ boolean cleanupAfterJob) {
AdvancedInputDataHandling inputDataHandling = new AdvancedInputDataHandling();
inputDataHandling.setStageInputFilesToWorkingDir(stageInputFilesToWorkingDir);
-// inputDataHandling.setWorkingDirectoryParent(workingDirParent);
+ inputDataHandling.setParentWorkingDirectory(parentWorkingDir);
inputDataHandling.setUniqueWorkingDirectory(uniqueWorkingDir);
inputDataHandling.setCleanUpWorkingDirAfterJob(cleanupAfterJob);
return inputDataHandling;
}
- public static AdvancedOutputDataHandling createOutputDataHandling (String outputDatadir,
- String dataRegUrl,
- boolean persistOutput){
+ public static AdvancedOutputDataHandling createOutputDataHandling(String outputDatadir,
+ String dataRegUrl,
+ boolean persistOutput) {
AdvancedOutputDataHandling outputDataHandling = new AdvancedOutputDataHandling();
-// outputDataHandling.setOutputdataDir(outputDatadir);
+ outputDataHandling.setOutputDataDir(outputDatadir);
outputDataHandling.setDataRegistryURL(dataRegUrl);
outputDataHandling.setPersistOutputData(persistOutput);
return outputDataHandling;
}
- public static QualityOfServiceParams createQOSParams (String startExecutionAt,
- String executeBefore,
- int numberOfRetires){
+ public static QualityOfServiceParams createQOSParams(String startExecutionAt,
+ String executeBefore,
+ int numberOfRetires) {
QualityOfServiceParams qosParams = new QualityOfServiceParams();
qosParams.setStartExecutionAt(startExecutionAt);
qosParams.setExecuteBefore(executeBefore);
http://git-wip-us.apache.org/repos/asf/airavata/blob/b66eba94/airavata-api/pom.xml
----------------------------------------------------------------------
diff --git a/airavata-api/pom.xml b/airavata-api/pom.xml
index 2c90d14..8c593fb 100644
--- a/airavata-api/pom.xml
+++ b/airavata-api/pom.xml
@@ -33,6 +33,7 @@
<modules>
<module>airavata-api-stubs</module>
<module>airavata-data-models</module>
+ <module>airavata-model-utils</module>
<module>airavata-api-server</module>
<module>airavata-client-sdks</module>
</modules>
http://git-wip-us.apache.org/repos/asf/airavata/blob/b66eba94/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 31f15ed..6517306 100644
--- a/airavata-api/thrift-interface-descriptions/experimentModel.thrift
+++ b/airavata-api/thrift-interface-descriptions/experimentModel.thrift
@@ -259,7 +259,8 @@ struct JobDetails {
3: optional i64 creationTime,
4: optional JobStatus jobStatus,
5: optional ApplicationStatus applicationStatus,
- 6: optional list<ErrorDetails> errors
+ 6: optional list<ErrorDetails> errors,
+ 7: optional string computeResourceConsumed
}
struct DataTransferDetails {