airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject [4/4] git commit: fixing AIRAVATA-1404 and AIRAVATA-1405
Date Wed, 20 Aug 2014 15:39:41 GMT
fixing AIRAVATA-1404 and AIRAVATA-1405


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/6305d3a5
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/6305d3a5
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/6305d3a5

Branch: refs/heads/master
Commit: 6305d3a51ffd51b19a77ae255e01425e0ca0e1c7
Parents: 5bdb49d
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Wed Aug 20 11:38:37 2014 -0400
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Wed Aug 20 11:38:37 2014 -0400

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   |   85 +-
 .../java/org/apache/airavata/api/Airavata.java  | 4612 ++++++++++++++++--
 .../main/resources/lib/airavata/Airavata.cpp    | 1566 +++++-
 .../src/main/resources/lib/airavata/Airavata.h  |  410 +-
 .../lib/airavata/Airavata_server.skeleton.cpp   |   10 +
 .../resources/lib/Airavata/API/Airavata.php     | 1098 ++++-
 .../client/samples/CreateLaunchExperiment.java  |    2 +-
 .../samples/TestCreateLaunchExperiment.java     |   43 +-
 .../model/workspace/experiment/Experiment.java  |    2 +-
 .../model/workspace/experiment/TaskStatus.java  |    2 +-
 .../airavataAPI.thrift                          |   24 +
 .../registry/jpa/impl/ExperimentRegistry.java   |    2 +-
 12 files changed, 6926 insertions(+), 930 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/6305d3a5/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index 4e4bab9..1051654 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -62,22 +62,13 @@ import org.apache.airavata.model.error.LaunchValidationException;
 import org.apache.airavata.model.error.ProjectNotFoundException;
 import org.apache.airavata.model.util.ExecutionType;
 import org.apache.airavata.model.workspace.Project;
-import org.apache.airavata.model.workspace.experiment.ComputationalResourceScheduling;
-import org.apache.airavata.model.workspace.experiment.DataObjectType;
-import org.apache.airavata.model.workspace.experiment.Experiment;
-import org.apache.airavata.model.workspace.experiment.ExperimentState;
-import org.apache.airavata.model.workspace.experiment.ExperimentStatus;
-import org.apache.airavata.model.workspace.experiment.ExperimentSummary;
-import org.apache.airavata.model.workspace.experiment.JobDetails;
-import org.apache.airavata.model.workspace.experiment.JobStatus;
-import org.apache.airavata.model.workspace.experiment.TaskDetails;
-import org.apache.airavata.model.workspace.experiment.UserConfigurationData;
-import org.apache.airavata.model.workspace.experiment.WorkflowNodeDetails;
+import org.apache.airavata.model.workspace.experiment.*;
 import org.apache.airavata.orchestrator.client.OrchestratorClientFactory;
 import org.apache.airavata.orchestrator.cpi.OrchestratorService;
 import org.apache.airavata.orchestrator.cpi.OrchestratorService.Client;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
+import org.apache.airavata.persistance.registry.jpa.model.JobDetail;
 import org.apache.airavata.registry.cpi.ChildDataType;
 import org.apache.airavata.registry.cpi.ParentDataType;
 import org.apache.airavata.registry.cpi.Registry;
@@ -1042,6 +1033,78 @@ public class AiravataServerHandler implements Airavata.Iface, Watcher
{
         return jobStatus;
     }
 
+    @Override
+    public List<JobDetails> getJobDetails(String airavataExperimentId) throws InvalidRequestException,
ExperimentNotFoundException, AiravataClientException, AiravataSystemException, TException
{
+        List<JobDetails> jobDetailsList = new ArrayList<JobDetails>();
+        try {
+            registry = RegistryFactory.getDefaultRegistry();
+            if (!registry.isExist(RegistryModelType.EXPERIMENT, airavataExperimentId)){
+                throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId
+ " does not exist in the system..");
+            }
+            List<Object> workflowNodes = registry.get(RegistryModelType.WORKFLOW_NODE_DETAIL,
Constants.FieldConstants.WorkflowNodeConstants.EXPERIMENT_ID, airavataExperimentId);
+            if (workflowNodes != null && !workflowNodes.isEmpty()){
+                for (Object wf : workflowNodes){
+                    String nodeInstanceId = ((WorkflowNodeDetails) wf).getNodeInstanceId();
+                    List<Object> taskDetails = registry.get(RegistryModelType.TASK_DETAIL,
Constants.FieldConstants.TaskDetailConstants.NODE_ID, nodeInstanceId);
+                    if (taskDetails != null && !taskDetails.isEmpty()){
+                        for (Object ts : taskDetails){
+                            String taskID = ((TaskDetails) ts).getTaskID();
+                            List<Object> jobDetails = registry.get(RegistryModelType.JOB_DETAIL,
Constants.FieldConstants.JobDetaisConstants.TASK_ID, taskID);
+                            if (jobDetails != null && !jobDetails.isEmpty()){
+                                for (Object job : jobDetails){
+                                    jobDetailsList.add((JobDetails) job);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            logger.error("Error while retrieving the job details", e);
+            AiravataSystemException exception = new AiravataSystemException();
+            exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+            exception.setMessage("Error while retrieving the job details. More info : " +
e.getMessage());
+            throw exception;
+        }
+        return jobDetailsList;
+    }
+
+    @Override
+    public List<DataTransferDetails> getDataTransferDetails(String airavataExperimentId)
throws InvalidRequestException, ExperimentNotFoundException, AiravataClientException, AiravataSystemException,
TException {
+        List<DataTransferDetails> dataTransferDetailList = new ArrayList<DataTransferDetails>();
+        try {
+            registry = RegistryFactory.getDefaultRegistry();
+            if (!registry.isExist(RegistryModelType.EXPERIMENT, airavataExperimentId)){
+                throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId
+ " does not exist in the system..");
+            }
+            List<Object> workflowNodes = registry.get(RegistryModelType.WORKFLOW_NODE_DETAIL,
Constants.FieldConstants.WorkflowNodeConstants.EXPERIMENT_ID, airavataExperimentId);
+            if (workflowNodes != null && !workflowNodes.isEmpty()){
+                for (Object wf : workflowNodes){
+                    String nodeInstanceId = ((WorkflowNodeDetails) wf).getNodeInstanceId();
+                    List<Object> taskDetails = registry.get(RegistryModelType.TASK_DETAIL,
Constants.FieldConstants.TaskDetailConstants.NODE_ID, nodeInstanceId);
+                    if (taskDetails != null && !taskDetails.isEmpty()){
+                        for (Object ts : taskDetails){
+                            String taskID = ((TaskDetails) ts).getTaskID();
+                            List<Object> dataTransferDetails = registry.get(RegistryModelType.DATA_TRANSFER_DETAIL,
Constants.FieldConstants.JobDetaisConstants.TASK_ID, taskID);
+                            if (dataTransferDetails != null && !dataTransferDetails.isEmpty()){
+                                for (Object dataTransfer : dataTransferDetails){
+                                    dataTransferDetailList.add((DataTransferDetails) dataTransfer);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            logger.error("Error while retrieving the data transfer details", e);
+            AiravataSystemException exception = new AiravataSystemException();
+            exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+            exception.setMessage("Error while retrieving the data transfer details. More
info : " + e.getMessage());
+            throw exception;
+        }
+        return dataTransferDetailList;
+    }
+
     /**
      * 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.


Mime
View raw message