airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject [12/13] airavata git commit: fixing AIRAVATA-1584
Date Tue, 24 Feb 2015 15:58:05 GMT
fixing AIRAVATA-1584


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

Branch: refs/heads/queue-gfac-rabbitmq
Commit: 33d2e27a4d329f95ce12ba621817ef9e2b956fb4
Parents: d9ae024
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Thu Feb 19 15:10:38 2015 -0500
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Thu Feb 19 15:10:38 2015 -0500

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   |   86 +-
 .../java/org/apache/airavata/api/Airavata.java  | 6323 ++++++++++++++++--
 .../main/resources/lib/airavata/Airavata.cpp    | 5246 +++++++++------
 .../src/main/resources/lib/airavata/Airavata.h  |  636 ++
 .../lib/airavata/Airavata_server.skeleton.cpp   |   20 +
 .../resources/lib/Airavata/API/Airavata.php     | 1270 +++-
 .../client/samples/CreateLaunchExperiment.java  |   12 +-
 .../airavataAPI.thrift                          |   23 +
 .../appcatalog/cpi/ComputeResource.java         |    3 +
 .../catalog/data/impl/ComputeResourceImpl.java  |   30 +-
 .../catalog/data/model/UnicoreDataMovement.java |   65 +
 .../data/resources/AbstractResource.java        |    7 +
 .../resources/UnicoreDataMovementResource.java  |  255 +
 .../catalog/data/util/AppCatalogJPAUtils.java   |   19 +-
 .../data/util/AppCatalogResourceType.java       |    1 +
 .../data/util/AppCatalogThriftConversion.java   |   20 +-
 .../src/main/resources/META-INF/persistence.xml |    1 +
 .../src/main/resources/appcatalog-derby.sql     |    8 +
 .../src/main/resources/appcatalog-mysql.sql     |    9 +
 .../src/test/resources/appcatalog-derby.sql     |    8 +
 .../main/resources/airavata-server.properties   |    2 +-
 .../messaging/client/RabbitMQListner.java       |   15 +
 .../messaging/core/impl/RabbitMQPublisher.java  |    2 +-
 .../messaging/core/stats/CountWriterTask.java   |   36 +
 .../messaging/core/stats/LatencyWriterTask.java |   37 +
 .../messaging/core/stats/StatCounter.java       |   38 +-
 .../messaging/core/stats/WriterTask.java        |   39 -
 27 files changed, 11606 insertions(+), 2605 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/33d2e27a/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 8e2ca17..722c1d0 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
@@ -28,13 +28,7 @@ import org.airavata.appcatalog.cpi.ComputeResource;
 import org.airavata.appcatalog.cpi.GwyResourceProfile;
 import org.airavata.appcatalog.cpi.WorkflowCatalog;
 import org.apache.aiaravata.application.catalog.data.impl.AppCatalogFactory;
-import org.apache.aiaravata.application.catalog.data.resources.AbstractResource;
-import org.apache.aiaravata.application.catalog.data.resources.CloudSubmissionResource;
-import org.apache.aiaravata.application.catalog.data.resources.GridftpDataMovementResource;
-import org.apache.aiaravata.application.catalog.data.resources.LocalDataMovementResource;
-import org.apache.aiaravata.application.catalog.data.resources.LocalSubmissionResource;
-import org.apache.aiaravata.application.catalog.data.resources.ScpDataMovementResource;
-import org.apache.aiaravata.application.catalog.data.resources.SshJobSubmissionResource;
+import org.apache.aiaravata.application.catalog.data.resources.*;
 import org.apache.aiaravata.application.catalog.data.util.AppCatalogThriftConversion;
 import org.apache.airavata.api.Airavata;
 import org.apache.airavata.api.airavataAPIConstants;
@@ -53,19 +47,7 @@ import org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule;
 import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
 import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
 import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
-import org.apache.airavata.model.appcatalog.computeresource.CloudJobSubmission;
-import org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription;
-import org.apache.airavata.model.appcatalog.computeresource.DataMovementInterface;
-import org.apache.airavata.model.appcatalog.computeresource.DataMovementProtocol;
-import org.apache.airavata.model.appcatalog.computeresource.GridFTPDataMovement;
-import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionInterface;
-import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionProtocol;
-import org.apache.airavata.model.appcatalog.computeresource.LOCALDataMovement;
-import org.apache.airavata.model.appcatalog.computeresource.LOCALSubmission;
-import org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager;
-import org.apache.airavata.model.appcatalog.computeresource.SCPDataMovement;
-import org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission;
-import org.apache.airavata.model.appcatalog.computeresource.UnicoreJobSubmission;
+import org.apache.airavata.model.appcatalog.computeresource.*;
 import org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference;
 import org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile;
 import org.apache.airavata.model.error.AiravataClientConnectException;
@@ -2025,6 +2007,23 @@ public class AiravataServerHandler implements Airavata.Iface {
             throw exception;
         }
     }
+
+    @Override
+    public boolean updateUnicoreJobSubmissionDetails(String jobSubmissionInterfaceId, UnicoreJobSubmission
unicoreJobSubmission) throws InvalidRequestException, AiravataClientException, AiravataSystemException,
TException {
+        try {
+            UnicoreJobSubmissionResource submission = AppCatalogThriftConversion.getUnicoreJobSubmission(unicoreJobSubmission);
+            submission.setjobSubmissionInterfaceId(jobSubmissionInterfaceId);
+            submission.save();
+            return true;
+        } catch (AppCatalogException e) {
+            logger.errorId(jobSubmissionInterfaceId, "Error while adding job submission interface
to resource compute resource...", e);
+            AiravataSystemException exception = new AiravataSystemException();
+            exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+            exception.setMessage("Error while adding job submission interface to resource
compute resource. More info : " + e.getMessage());
+            throw exception;
+        }
+    }
+
     /**
      * Add a Local data moevement details to a compute resource
      * App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
@@ -2167,6 +2166,53 @@ public class AiravataServerHandler implements Airavata.Iface {
         }
     }
 
+    @Override
+    public String addUnicoreDataMovementDetails(String computeResourceId, int priorityOrder,
UnicoreDataMovement unicoreDataMovement) throws InvalidRequestException, AiravataClientException,
AiravataSystemException, TException {
+        try {
+            appCatalog = AppCatalogFactory.getAppCatalog();
+            ComputeResource computeResource = appCatalog.getComputeResource();
+            return addDataMovementInterface(computeResource, computeResourceId,
+                    computeResource.addUnicoreDataMovement(unicoreDataMovement), DataMovementProtocol.UNICORE_STORAGE_SERVICE,
priorityOrder);
+        } catch (AppCatalogException e) {
+            logger.errorId(computeResourceId, "Error while adding data movement interface
to resource compute resource...", e);
+            AiravataSystemException exception = new AiravataSystemException();
+            exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+            exception.setMessage("Error while adding data movement interface to resource
compute resource. More info : " + e.getMessage());
+            throw exception;
+        }
+    }
+
+    @Override
+    public boolean updateUnicoreDataMovementDetails(String dataMovementInterfaceId, UnicoreDataMovement
unicoreDataMovement) throws InvalidRequestException, AiravataClientException, AiravataSystemException,
TException {
+        try {
+            UnicoreDataMovementResource movment = AppCatalogThriftConversion.getUnicoreDMResource(unicoreDataMovement);
+            movment.setDataMovementId(dataMovementInterfaceId);
+            movment.save();
+            return true;
+        } catch (AppCatalogException e) {
+            logger.errorId(dataMovementInterfaceId, "Error while updating unicore data movement
to compute resource...", e);
+            AiravataSystemException exception = new AiravataSystemException();
+            exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+            exception.setMessage("Error while updating unicore data movement to compute resource.
More info : " + e.getMessage());
+            throw exception;
+        }
+    }
+
+    @Override
+    public UnicoreDataMovement getUnicoreDataMovement(String dataMovementId) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, TException {
+        try {
+            appCatalog = AppCatalogFactory.getAppCatalog();
+            return appCatalog.getComputeResource().getUNICOREDataMovement(dataMovementId);
+        } catch (AppCatalogException e) {
+            String errorMsg = "Error while retrieving UNICORE data movement interface...";
+            logger.errorId(dataMovementId, errorMsg, e);
+            AiravataSystemException exception = new AiravataSystemException();
+            exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+            exception.setMessage(errorMsg + e.getMessage());
+            throw exception;
+        }
+    }
+
     /**
      * Add a GridFTP data moevement details to a compute resource
      * App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.


Mime
View raw message