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/02/21 20:51:36 UTC
git commit: adding add method to data objects - workflow node, task,
experiment outputs etc - AIRAVATA-1006
Repository: airavata
Updated Branches:
refs/heads/master 3b77227ea -> 9b858526d
adding add method to data objects - workflow node, task, experiment outputs etc - AIRAVATA-1006
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/9b858526
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/9b858526
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/9b858526
Branch: refs/heads/master
Commit: 9b858526db516d0821188540a6f2f198a3141a68
Parents: 3b77227
Author: chathuri <ch...@apache.org>
Authored: Fri Feb 21 14:51:30 2014 -0500
Committer: chathuri <ch...@apache.org>
Committed: Fri Feb 21 14:51:30 2014 -0500
----------------------------------------------------------------------
.../registry/jpa/impl/ExperimentRegistry.java | 225 ++++++++++++++++---
.../registry/jpa/impl/RegistryImpl.java | 64 +++---
.../airavata/registry/cpi/ChildDataType.java | 7 +-
.../registry/cpi/CompositeIdentifier.java | 44 ++++
.../apache/airavata/registry/cpi/Registry.java | 22 +-
5 files changed, 282 insertions(+), 80 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/9b858526/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
index b9d7dc1..6906028 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
@@ -29,7 +29,9 @@ import org.apache.airavata.persistance.registry.jpa.ResourceType;
import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
import org.apache.airavata.persistance.registry.jpa.resources.*;
import org.apache.airavata.persistance.registry.jpa.utils.ThriftDataModelConversion;
+import org.apache.airavata.registry.cpi.CompositeIdentifier;
import org.apache.airavata.registry.cpi.utils.Constants;
+import org.apache.airavata.registry.cpi.utils.StatusType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -71,7 +73,10 @@ public class ExperimentRegistry {
experimentResource.setWorkflowExecutionId(experiment.getWorkflowExecutionInstanceId());
experimentResource.save();
List<DataObjectType> experimentInputs = experiment.getExperimentInputs();
- addExpInputs(experimentInputs, experimentResource);
+ if (experimentInputs != null){
+ addExpInputs(experimentInputs, experimentResource);
+ }
+
} catch (ApplicationSettingsException e) {
logger.error("Unable to read airavata-server properties", e.getMessage());
}catch (Exception e){
@@ -80,7 +85,7 @@ public class ExperimentRegistry {
return experimentID;
}
- public void addUserConfigData(UserConfigurationData configurationData, String experimentID) {
+ public String addUserConfigData(UserConfigurationData configurationData, String experimentID) {
try {
gatewayRegistry = new GatewayRegistry();
GatewayResource gateway = gatewayRegistry.getDefaultGateway();
@@ -93,48 +98,21 @@ public class ExperimentRegistry {
ComputationalResourceScheduling resourceScheduling = configurationData.getComputationalResourceScheduling();
if (resourceScheduling != null) {
- ComputationSchedulingResource cmsr = new ComputationSchedulingResource();
- cmsr.setExperimentResource(experiment);
- cmsr.setResourceHostId(resourceScheduling.getResourceHostId());
- cmsr.setCpuCount(resourceScheduling.getTotalCPUCount());
- cmsr.setNodeCount(resourceScheduling.getNodeCount());
- cmsr.setNumberOfThreads(resourceScheduling.getNumberOfThreads());
- cmsr.setQueueName(resourceScheduling.getQueueName());
- cmsr.setWalltimeLimit(resourceScheduling.getWallTimeLimit());
- cmsr.setJobStartTime(getTime(resourceScheduling.getJobStartTime()));
- cmsr.setPhysicalMemory(resourceScheduling.getTotalPhysicalMemory());
- cmsr.setProjectName(resourceScheduling.getComputationalProjectAccount());
- cmsr.save();
+ addComputationScheduling(resourceScheduling, experiment);
}
AdvancedInputDataHandling inputDataHandling = configurationData.getAdvanceInputDataHandling();
if (inputDataHandling != null) {
- AdvanceInputDataHandlingResource adidh = new AdvanceInputDataHandlingResource();
- adidh.setExperimentResource(experiment);
- adidh.setWorkingDir(inputDataHandling.getUniqueWorkingDirectory());
- adidh.setWorkingDirParent(inputDataHandling.getParentWorkingDirectory());
- adidh.setStageInputFiles(inputDataHandling.isSetStageInputFilesToWorkingDir());
- adidh.setCleanAfterJob(inputDataHandling.isCleanUpWorkingDirAfterJob());
- adidh.save();
+ addInputDataHandling(inputDataHandling, experiment);
}
AdvancedOutputDataHandling outputDataHandling = configurationData.getAdvanceOutputDataHandling();
if (outputDataHandling != null) {
- AdvancedOutputDataHandlingResource adodh = new AdvancedOutputDataHandlingResource();
- adodh.setExperimentResource(experiment);
- adodh.setOutputDataDir(outputDataHandling.getOutputDataDir());
- adodh.setDataRegUrl(outputDataHandling.getDataRegistryURL());
- adodh.setPersistOutputData(outputDataHandling.isPersistOutputData());
- adodh.save();
+ addOutputDataHandling(outputDataHandling,experiment);
}
QualityOfServiceParams qosParams = configurationData.getQosParams();
if (qosParams != null) {
- QosParamResource qosr = new QosParamResource();
- qosr.setExperimentResource(experiment);
- qosr.setStartExecutionAt(qosParams.getStartExecutionAt());
- qosr.setExecuteBefore(qosParams.getExecuteBefore());
- qosr.setNoOfRetries(qosParams.getNumberofRetries());
- qosr.save();
+ addQosParams(qosParams,experiment);
}
configData.save();
} catch (ApplicationSettingsException e) {
@@ -142,6 +120,78 @@ public class ExperimentRegistry {
}catch (Exception e){
logger.error("Unable to save user config data", e.getMessage());
}
+ return experimentID;
+ }
+
+ public void addQosParams(QualityOfServiceParams qosParams, Resource resource) {
+ QosParamResource qosr = new QosParamResource();
+ if (resource instanceof ExperimentResource){
+ ExperimentResource experiment = (ExperimentResource)resource;
+ qosr.setExperimentResource(experiment);
+ }
+ if (resource instanceof TaskDetailResource){
+ TaskDetailResource taskDetailResource = (TaskDetailResource)resource;
+ qosr.setTaskDetailResource(taskDetailResource);
+ }
+ qosr.setStartExecutionAt(qosParams.getStartExecutionAt());
+ qosr.setExecuteBefore(qosParams.getExecuteBefore());
+ qosr.setNoOfRetries(qosParams.getNumberofRetries());
+ qosr.save();
+ }
+
+ public void addOutputDataHandling(AdvancedOutputDataHandling outputDataHandling, Resource resource) {
+ AdvancedOutputDataHandlingResource adodh = new AdvancedOutputDataHandlingResource();
+ if (resource instanceof ExperimentResource){
+ ExperimentResource experiment = (ExperimentResource)resource;
+ adodh.setExperimentResource(experiment);
+ }
+ if (resource instanceof TaskDetailResource){
+ TaskDetailResource taskDetailResource = (TaskDetailResource)resource;
+ adodh.setTaskDetailResource(taskDetailResource);
+ }
+ adodh.setOutputDataDir(outputDataHandling.getOutputDataDir());
+ adodh.setDataRegUrl(outputDataHandling.getDataRegistryURL());
+ adodh.setPersistOutputData(outputDataHandling.isPersistOutputData());
+ adodh.save();
+ }
+
+ public void addInputDataHandling(AdvancedInputDataHandling inputDataHandling, Resource resource) {
+ AdvanceInputDataHandlingResource adidh = new AdvanceInputDataHandlingResource();
+ if (resource instanceof ExperimentResource){
+ ExperimentResource experiment = (ExperimentResource)resource;
+ adidh.setExperimentResource(experiment);
+ }
+ if (resource instanceof TaskDetailResource){
+ TaskDetailResource taskDetailResource = (TaskDetailResource)resource;
+ adidh.setTaskDetailResource(taskDetailResource);
+ }
+ adidh.setWorkingDir(inputDataHandling.getUniqueWorkingDirectory());
+ adidh.setWorkingDirParent(inputDataHandling.getParentWorkingDirectory());
+ adidh.setStageInputFiles(inputDataHandling.isSetStageInputFilesToWorkingDir());
+ adidh.setCleanAfterJob(inputDataHandling.isCleanUpWorkingDirAfterJob());
+ adidh.save();
+ }
+
+ public void addComputationScheduling(ComputationalResourceScheduling resourceScheduling, Resource resource) {
+ ComputationSchedulingResource cmsr = new ComputationSchedulingResource();
+ if (resource instanceof ExperimentResource){
+ ExperimentResource experiment = (ExperimentResource)resource;
+ cmsr.setExperimentResource(experiment);
+ }
+ if (resource instanceof TaskDetailResource){
+ TaskDetailResource taskDetailResource = (TaskDetailResource)resource;
+ cmsr.setTaskDetailResource(taskDetailResource);
+ }
+ cmsr.setResourceHostId(resourceScheduling.getResourceHostId());
+ cmsr.setCpuCount(resourceScheduling.getTotalCPUCount());
+ cmsr.setNodeCount(resourceScheduling.getNodeCount());
+ cmsr.setNumberOfThreads(resourceScheduling.getNumberOfThreads());
+ cmsr.setQueueName(resourceScheduling.getQueueName());
+ cmsr.setWalltimeLimit(resourceScheduling.getWallTimeLimit());
+ cmsr.setJobStartTime(getTime(resourceScheduling.getJobStartTime()));
+ cmsr.setPhysicalMemory(resourceScheduling.getTotalPhysicalMemory());
+ cmsr.setProjectName(resourceScheduling.getComputationalProjectAccount());
+ cmsr.save();
}
public void addExpInputs (List<DataObjectType> exInputs, ExperimentResource experimentResource ){
@@ -170,7 +220,7 @@ public class ExperimentRegistry {
}
}
- public void addExpOuputs (List<DataObjectType> exOutput, String expId ) {
+ public String addExpOuputs (List<DataObjectType> exOutput, String expId ) {
try {
gatewayRegistry = new GatewayRegistry();
GatewayResource gateway = gatewayRegistry.getDefaultGateway();
@@ -187,12 +237,119 @@ public class ExperimentRegistry {
} catch (ApplicationSettingsException e) {
logger.error("Unable to read airavata-server properties", e.getMessage());
}
+ return expId;
+ }
+
+ public String updateExperimentStatus (ExperimentStatus experimentStatus, String expId){
+ try{
+ gatewayRegistry = new GatewayRegistry();
+ GatewayResource gateway = gatewayRegistry.getDefaultGateway();
+ ExperimentResource experiment = gateway.getExperiment(expId);
+ StatusResource status = experiment.getExperimentStatus();
+ if (status == null){
+ status = (StatusResource)experiment.create(ResourceType.STATUS);
+ }
+ status.setExperimentResource(experiment);
+ status.setStatusUpdateTime(getTime(experimentStatus.getTimeOfStateChange()));
+ status.setState(experimentStatus.getExperimentState().toString());
+ status.setStatusType(StatusType.EXPERIMENT.toString());
+ status.save();
+ } catch (ApplicationSettingsException e) {
+ logger.error("Unable to read airavata-server properties", e.getMessage());
+ }
+ return expId;
+ }
+
+ public void addWorkflowNodeStatus(WorkflowNodeStatus status, String nodeId) {
+ try {
+ gatewayRegistry = new GatewayRegistry();
+ GatewayResource gateway = gatewayRegistry.getDefaultGateway();
+// ExperimentResource experiment = gateway.getExperiment(expId);
+// StatusResource resource = (StatusResource)experiment.create(ResourceType.STATUS);
+
+
+ } catch (ApplicationSettingsException e) {
+ logger.error("Unable to read airavata-server properties", e.getMessage());
+ }
+ }
+
+ public String addWorkflowNodeDetails (WorkflowNodeDetails nodeDetails, String expId) {
+ try {
+ gatewayRegistry = new GatewayRegistry();
+ GatewayResource gateway = gatewayRegistry.getDefaultGateway();
+ ExperimentResource experiment = gateway.getExperiment(expId);
+ WorkflowNodeDetailResource resource = (WorkflowNodeDetailResource)experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
+ resource.setExperimentResource(experiment);
+ resource.setNodeName(nodeDetails.getNodeName());
+ resource.setCreationTime(getTime(nodeDetails.getCreationTime()));
+ resource.setNodeInstanceId(getNodeInstanceID(nodeDetails.getNodeName()));
+ resource.save();
+ return resource.getNodeInstanceId();
+ } catch (ApplicationSettingsException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public String addTaskDetails (TaskDetails taskDetails, String nodeId) {
+ try {
+ gatewayRegistry = new GatewayRegistry();
+ GatewayResource gateway = gatewayRegistry.getDefaultGateway();
+ ExperimentResource experiment = (ExperimentResource)gateway.create(ResourceType.EXPERIMENT);
+ WorkflowNodeDetailResource workflowNode = experiment.getWorkflowNode(nodeId);
+ TaskDetailResource taskDetail = (TaskDetailResource)workflowNode.create(ResourceType.TASK_DETAIL);
+ taskDetail.setWorkflowNodeDetailResource(workflowNode);
+ taskDetail.setTaskId(getTaskID(workflowNode.getNodeName()));
+ taskDetail.setApplicationId(taskDetails.getApplicationId());
+ taskDetail.setApplicationVersion(taskDetails.getApplicationVersion());
+ taskDetail.setCreationTime(getTime(taskDetails.getCreationTime()));
+ List<DataObjectType> applicationInputs = taskDetails.getApplicationInputs();
+ if (applicationInputs != null){
+ addAppInputs(applicationInputs, taskDetail);
+ }
+ ComputationalResourceScheduling taskScheduling = taskDetails.getTaskScheduling();
+ if (taskScheduling != null){
+ addComputationScheduling(taskScheduling, taskDetail);
+ }
+ AdvancedInputDataHandling inputDataHandling = taskDetails.getAdvancedInputDataHandling();
+ if (inputDataHandling != null){
+ addInputDataHandling(inputDataHandling, taskDetail);
+ }
+ AdvancedOutputDataHandling outputDataHandling = taskDetails.getAdvancedOutputDataHandling();
+ if (outputDataHandling != null){
+ addOutputDataHandling(outputDataHandling, taskDetail);
+ }
+ return taskDetail.getTaskId();
+ } catch (ApplicationSettingsException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public void addAppInputs (List<DataObjectType> appInputs, TaskDetailResource taskDetailResource ){
+ for (DataObjectType input : appInputs){
+ ApplicationInputResource resource = (ApplicationInputResource)taskDetailResource.create(ResourceType.APPLICATION_INPUT);
+ resource.setTaskDetailResource(taskDetailResource);
+ resource.setInputKey(input.getKey());
+ resource.setValue(input.getValue());
+ resource.setInputType(input.getType());
+ resource.setMetadata(input.getMetaData());
+ resource.save();
+ }
+ }
+
+ public String getNodeInstanceID(String nodeName) {
+ return nodeName + "_" + UUID.randomUUID();
}
public String getExperimentID(String experimentName) {
return experimentName + "_" + UUID.randomUUID();
}
+ public String getTaskID(String nodeName) {
+ return nodeName + "_" + UUID.randomUUID();
+ }
+
public void updateExperimentField(String expID, String fieldName, Object value) {
try {
GatewayResource gateway = gatewayRegistry.getDefaultGateway();
http://git-wip-us.apache.org/repos/asf/airavata/blob/9b858526/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
index 670fca5..7787668 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/RegistryImpl.java
@@ -21,9 +21,7 @@
package org.apache.airavata.persistance.registry.jpa.impl;
-import org.apache.airavata.model.workspace.experiment.DataObjectType;
-import org.apache.airavata.model.workspace.experiment.Experiment;
-import org.apache.airavata.model.workspace.experiment.UserConfigurationData;
+import org.apache.airavata.model.workspace.experiment.*;
import org.apache.airavata.registry.cpi.ChildDataType;
import org.apache.airavata.registry.cpi.DataType;
import org.apache.airavata.registry.cpi.ParentDataType;
@@ -70,21 +68,19 @@ public class RegistryImpl implements Registry {
* null
*/
@Override
- public void add(ChildDataType dataType, Object newObjectToAdd, String dependentIdentifier) throws Exception{
+ public Object add(ChildDataType dataType, Object newObjectToAdd, Object dependentIdentifier) throws Exception{
switch (dataType){
case EXPERIMENT_CONFIGURATION_DATA:
- experimentRegistry.addUserConfigData((UserConfigurationData) newObjectToAdd, dependentIdentifier);
- break;
+ return experimentRegistry.addUserConfigData((UserConfigurationData) newObjectToAdd, (String)dependentIdentifier);
case EXPERIMENT_OUTPUT:
- experimentRegistry.addExpOuputs((List<DataObjectType>)newObjectToAdd, dependentIdentifier);
- break;
+ return experimentRegistry.addExpOuputs((List<DataObjectType>)newObjectToAdd, (String)dependentIdentifier);
+ case EXPERIMENT_STATUS:
+ return experimentRegistry.updateExperimentStatus((ExperimentStatus)newObjectToAdd, (String)dependentIdentifier);
+ case WORKFLOW_NODE_DETAIL:
+ return experimentRegistry.addWorkflowNodeDetails((WorkflowNodeDetails)newObjectToAdd, (String)dependentIdentifier);
case TASK_DETAIL:
- // no thrift model yet
- break;
- case ERROR_DETAIL:
- // no thrift model yet
- break;
- case APPLICATION_INPUT:
+ return experimentRegistry.addTaskDetails((TaskDetails)newObjectToAdd, (String)dependentIdentifier);
+ case WORKFLOW_NODE_STATUS:
// no thrift model yet
break;
case APPLICATION_OUTPUT:
@@ -99,9 +95,6 @@ public class RegistryImpl implements Registry {
case DATA_TRANSFER_DETAIL:
// no thrift model yet
break;
- case STATUS:
- // no thrift model yet
- break;
case ADVANCE_INPUT_DATA_HANDLING:
// no thrift model yet
break;
@@ -118,6 +111,7 @@ public class RegistryImpl implements Registry {
logger.error("Unsupported dependent data type...", new UnsupportedOperationException());
throw new UnsupportedOperationException();
}
+ return null;
}
@@ -132,13 +126,13 @@ public class RegistryImpl implements Registry {
* other fields that need to be updated.
*/
@Override
- public void update(DataType dataType, Object newObjectToUpdate, String identifier) throws Exception {
+ public void update(DataType dataType, Object newObjectToUpdate, Object identifier) throws Exception {
switch (dataType){
case EXPERIMENT:
- experimentRegistry.updateExperiment((Experiment) newObjectToUpdate, identifier);
+ experimentRegistry.updateExperiment((Experiment) newObjectToUpdate, (String)identifier);
break;
case EXPERIMENT_CONFIGURATION_DATA:
- experimentRegistry.updateUserConfigData((UserConfigurationData) newObjectToUpdate, identifier);
+ experimentRegistry.updateUserConfigData((UserConfigurationData) newObjectToUpdate, (String)identifier);
break;
default:
logger.error("Unsupported data type...", new UnsupportedOperationException());
@@ -159,13 +153,13 @@ public class RegistryImpl implements Registry {
* updated by given value
*/
@Override
- public void update(DataType dataType, String identifier, String fieldName, Object value) throws Exception {
+ public void update(DataType dataType, Object identifier, String fieldName, Object value) throws Exception {
switch (dataType){
case EXPERIMENT:
- experimentRegistry.updateExperimentField(identifier, fieldName, value);
+ experimentRegistry.updateExperimentField((String)identifier, fieldName, value);
break;
case EXPERIMENT_CONFIGURATION_DATA:
- experimentRegistry.updateExpConfigDataField(identifier, fieldName, value);
+ experimentRegistry.updateExpConfigDataField((String)identifier, fieldName, value);
break;
default:
logger.error("Unsupported data type...", new UnsupportedOperationException());
@@ -183,13 +177,13 @@ public class RegistryImpl implements Registry {
* @return object according to the given identifier.
*/
@Override
- public Object get(DataType dataType, String identifier) throws Exception {
+ public Object get(DataType dataType, Object identifier) throws Exception {
switch (dataType){
case EXPERIMENT:
- return experimentRegistry.getExperiment(identifier, null);
+ return experimentRegistry.getExperiment((String)identifier, null);
case EXPERIMENT_CONFIGURATION_DATA:
- return experimentRegistry.getConfigData(identifier, null);
+ return experimentRegistry.getConfigData((String)identifier, null);
default:
logger.error("Unsupported data type...", new UnsupportedOperationException());
throw new UnsupportedOperationException();
@@ -233,12 +227,12 @@ public class RegistryImpl implements Registry {
* given
*/
@Override
- public Object getValue(DataType dataType, String identifier, String field) throws Exception {
+ public Object getValue(DataType dataType, Object identifier, String field) throws Exception {
switch (dataType){
case EXPERIMENT:
- return experimentRegistry.getExperiment(identifier, field);
+ return experimentRegistry.getExperiment((String)identifier, field);
case EXPERIMENT_CONFIGURATION_DATA:
- return experimentRegistry.getConfigData(identifier, field);
+ return experimentRegistry.getConfigData((String)identifier, field);
default:
logger.error("Unsupported data type...", new UnsupportedOperationException());
throw new UnsupportedOperationException();
@@ -277,13 +271,13 @@ public class RegistryImpl implements Registry {
* identifier will be generated experimentID
*/
@Override
- public void remove(DataType dataType, String identifier) throws Exception {
+ public void remove(DataType dataType, Object identifier) throws Exception {
switch (dataType){
case EXPERIMENT:
- experimentRegistry.removeExperiment(identifier);
+ experimentRegistry.removeExperiment((String)identifier);
break;
case EXPERIMENT_CONFIGURATION_DATA:
- experimentRegistry.removeExperimentConfigData(identifier);
+ experimentRegistry.removeExperimentConfigData((String)identifier);
default:
logger.error("Unsupported data type...", new UnsupportedOperationException());
throw new UnsupportedOperationException();
@@ -299,12 +293,12 @@ public class RegistryImpl implements Registry {
* @return whether the given data type exists or not
*/
@Override
- public boolean isExist(DataType dataType, String identifier) throws Exception {
+ public boolean isExist(DataType dataType, Object identifier) throws Exception {
switch (dataType){
case EXPERIMENT:
- return experimentRegistry.isExperimentExist(identifier);
+ return experimentRegistry.isExperimentExist((String)identifier);
case EXPERIMENT_CONFIGURATION_DATA:
- return experimentRegistry.isExperimentConfigDataExist(identifier);
+ return experimentRegistry.isExperimentConfigDataExist((String)identifier);
}
return false;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9b858526/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ChildDataType.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ChildDataType.java b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ChildDataType.java
index 27c1231..14758f6 100644
--- a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ChildDataType.java
+++ b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ChildDataType.java
@@ -3,8 +3,14 @@ package org.apache.airavata.registry.cpi;
public enum ChildDataType {
EXPERIMENT_INPUT,
EXPERIMENT_OUTPUT,
+ EXPERIMENT_STATUS,
WORKFLOW_NODE_DETAIL,
TASK_DETAIL,
+ WORKFLOW_NODE_STATUS,
+ TASK_STATUS,
+ APPLICATION_STATUS,
+ JOB_STATUS,
+ TRANSFER_STATUS,
ERROR_DETAIL,
APPLICATION_INPUT,
APPLICATION_OUTPUT,
@@ -12,7 +18,6 @@ public enum ChildDataType {
NODE_OUTPUT,
JOB_DETAIL,
DATA_TRANSFER_DETAIL,
- STATUS,
EXPERIMENT_CONFIGURATION_DATA,
COMPUTATIONAL_RESOURCE_SCHEDULING,
ADVANCE_INPUT_DATA_HANDLING,
http://git-wip-us.apache.org/repos/asf/airavata/blob/9b858526/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/CompositeIdentifier.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/CompositeIdentifier.java b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/CompositeIdentifier.java
new file mode 100644
index 0000000..0234aa3
--- /dev/null
+++ b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/CompositeIdentifier.java
@@ -0,0 +1,44 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+package org.apache.airavata.registry.cpi;
+
+/**
+ * This class is to uniquely identify third layer child objects. For example, workflow node status object can be
+ * uniquely identified with experiment id and node id.
+ */
+public class CompositeIdentifier {
+ private Object topLevelIdentifier;
+ private Object secondLevelIdentifier;
+
+ public CompositeIdentifier(Object topLevelIdentifier, Object secondLevelIdentifier) {
+ this.topLevelIdentifier = topLevelIdentifier;
+ this.secondLevelIdentifier = secondLevelIdentifier;
+ }
+
+ public Object getTopLevelIdentifier() {
+ return topLevelIdentifier;
+ }
+
+ public Object getSecondLevelIdentifier() {
+ return secondLevelIdentifier;
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/9b858526/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/Registry.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/Registry.java b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/Registry.java
index 531f281..003daa7 100644
--- a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/Registry.java
+++ b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/Registry.java
@@ -25,11 +25,13 @@ public interface Registry {
* @param newObjectToAdd Object which contains the fields that need to be saved in to registry. This object is a
* thrift model object. In experiment case this object can be BasicMetadata, ConfigurationData
* etc
- * @param dependentIdentifier Object which contains the identifier if the object that is going to add is not a top
- * level object in the data model. If it is a top level object, programmer can pass it as
- * null
+ * @param dependentIdentifiers contains the identifier if the object that is going to add is not a top
+ * level object in the data model. This object can be a simple string or a
+ * org.apache.airavata.registry.cpi.CompositeIdentifier type if it is a child element
+ * with multiple identifiers
+ * @return return the identifier to identify the object
*/
- public void add(ChildDataType dataType, Object newObjectToAdd, String dependentIdentifier) throws Exception;
+ public Object add(ChildDataType dataType, Object newObjectToAdd, Object dependentIdentifiers) throws Exception;
/**
* This method is to update the whole object in registry
@@ -41,7 +43,7 @@ public interface Registry {
* have to fill the whole object. He needs to only fill the mandatory fields and whatever the
* other fields that need to be updated.
*/
- public void update(DataType dataType, Object newObjectToUpdate, String identifier) throws Exception;
+ public void update(DataType dataType, Object newObjectToUpdate, Object identifier) throws Exception;
/**
@@ -56,7 +58,7 @@ public interface Registry {
* @param value Value by which the given field need to be updated. If the field is "description", that field will be
* updated by given value
*/
- public void update(DataType dataType, String identifier, String fieldName, Object value) throws Exception;
+ public void update(DataType dataType, Object identifier, String fieldName, Object value) throws Exception;
/**
* This method is to retrieve object according to the identifier. In the experiment basic data type, if you give the
@@ -67,7 +69,7 @@ public interface Registry {
* identifier will be generated experimentID
* @return object according to the given identifier.
*/
- public Object get(DataType dataType, String identifier) throws Exception;
+ public Object get(DataType dataType, Object identifier) throws Exception;
/**
* This method is to retrieve list of objects according to a given criteria
@@ -91,7 +93,7 @@ public interface Registry {
* @return return the value for the specific field where data model is identified by the unique identifier that has
* given
*/
- public Object getValue (DataType dataType, String identifier, String field) throws Exception;
+ public Object getValue (DataType dataType, Object identifier, String field) throws Exception;
/**
* This method is to retrieve all the identifiers according to given filtering criteria. For an example, if you want
@@ -113,7 +115,7 @@ public interface Registry {
* @param identifier Identifier which will uniquely identify the data model. For example, in Experiment_Basic_Type,
* identifier will be generated experimentID
*/
- public void remove (DataType dataType, String identifier) throws Exception;
+ public void remove (DataType dataType, Object identifier) throws Exception;
/**
* This method will check whether a given data type which can be identified with the identifier exists or not
@@ -123,7 +125,7 @@ public interface Registry {
* identifier will be generated experimentID
* @return whether the given data type exists or not
*/
- public boolean isExist(DataType dataType, String identifier) throws Exception;
+ public boolean isExist(DataType dataType, Object identifier) throws Exception;
}