airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject git commit: adding util methods to get job submission
Date Thu, 30 Oct 2014 21:06:19 GMT
Repository: airavata
Updated Branches:
  refs/heads/gfac_appcatalog_int add6b58a0 -> 14bd9416a


adding util methods to get job submission


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

Branch: refs/heads/gfac_appcatalog_int
Commit: 14bd9416af4ced1702086a43f82dacc35b4b8a46
Parents: add6b58
Author: chathuriw <kamalasini@gmail.com>
Authored: Thu Oct 30 17:06:06 2014 -0400
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Thu Oct 30 17:06:06 2014 -0400

----------------------------------------------------------------------
 .../org/apache/airavata/gfac/Scheduler.java     |  4 +--
 .../core/handler/AppDescriptorCheckHandler.java |  6 ++--
 .../airavata/gfac/core/utils/GFacUtils.java     | 38 ++++++++++++++++++++
 3 files changed, 43 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/14bd9416/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/Scheduler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/Scheduler.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/Scheduler.java
index 8f5847f..9e642fe 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/Scheduler.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/Scheduler.java
@@ -109,7 +109,7 @@ public class Scheduler {
             if (provider == null) {
 
                 List<JobSubmissionInterface> jobSubmissionInterfaces = jobExecutionContext.getApplicationContext().getComputeResourceDescription().getJobSubmissionInterfaces();
-                String hostClass = jobExecutionContext.getPrefferedJobSubmissionProtocal();
+                String hostClass = jobExecutionContext.getPreferredJobSubmissionProtocol().toString();
                 providerClassName = GFacConfiguration.getAttributeValue(GFacConfiguration.getHandlerDoc(),
Constants.XPATH_EXPR_PROVIDER_ON_HOST + hostClass + "']", Constants.GFAC_CONFIG_CLASS_ATTRIBUTE);
                 Class<? extends GFacProvider> aClass1 = Class.forName(providerClassName).asSubclass(GFacProvider.class);
                 provider = aClass1.newInstance();
@@ -162,7 +162,7 @@ public class Scheduler {
             // This should be have a single element only.
 
             if (executionMode == null || "".equals(executionMode)) {
-                String hostClass = jobExecutionContext.getPrefferedJobSubmissionProtocal();
+                String hostClass = jobExecutionContext.getPreferredJobSubmissionProtocol().toString();
                 executionMode = GFacConfiguration.getAttributeValue(GFacConfiguration.getHandlerDoc(),
Constants.XPATH_EXPR_PROVIDER_ON_HOST + hostClass + "']", Constants.GFAC_CONFIG_EXECUTION_MODE_ATTRIBUTE);
             }
         } catch (XPathExpressionException e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/14bd9416/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/AppDescriptorCheckHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/AppDescriptorCheckHandler.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/AppDescriptorCheckHandler.java
index 4627bf5..72a8f1f 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/AppDescriptorCheckHandler.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/handler/AppDescriptorCheckHandler.java
@@ -53,7 +53,7 @@ public class AppDescriptorCheckHandler implements GFacRecoverableHandler
{
         /*
         * Stdout and Stderr for Shell
         */
-        data.append(",").append(jobExecutionContext.getStandaredOutput()).append(",").append(jobExecutionContext.getStandaredError());
+        data.append(",").append(jobExecutionContext.getStandardOutput()).append(",").append(jobExecutionContext.getStandardError());
 
 
         logger.info("Recoverable data is saving to zk: " + data.toString());
@@ -74,8 +74,8 @@ public class AppDescriptorCheckHandler implements GFacRecoverableHandler
{
             jobExecutionContext.setWorkingDir(split[1]);
             jobExecutionContext.setInputDir(split[2]);
             jobExecutionContext.setOutputDir(split[3]);
-            jobExecutionContext.setStandaredOutput(split[4]);
-            jobExecutionContext.setStandaredError(split[5]);
+            jobExecutionContext.setStandardOutput(split[4]);
+            jobExecutionContext.setStandardError(split[5]);
         } catch (Exception e) {
             throw new GFacHandlerException(e);
         }

http://git-wip-us.apache.org/repos/asf/airavata/blob/14bd9416/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
index 71f8cfe..695c943 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
@@ -20,6 +20,9 @@
  */
 package org.apache.airavata.gfac.core.utils;
 
+import org.airavata.appcatalog.cpi.AppCatalog;
+import org.airavata.appcatalog.cpi.AppCatalogException;
+import org.apache.aiaravata.application.catalog.data.impl.AppCatalogFactory;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.AiravataZKUtils;
 import org.apache.airavata.common.utils.DBUtil;
@@ -36,6 +39,8 @@ import org.apache.airavata.gfac.core.context.JobExecutionContext;
 import org.apache.airavata.gfac.core.handler.GFacHandlerException;
 import org.apache.airavata.gfac.core.states.GfacExperimentState;
 import org.apache.airavata.gfac.core.states.GfacPluginState;
+import org.apache.airavata.model.appcatalog.computeresource.LOCALSubmission;
+import org.apache.airavata.model.appcatalog.computeresource.UnicoreJobSubmission;
 import org.apache.airavata.model.workspace.experiment.*;
 import org.apache.airavata.model.workspace.experiment.DataType;
 import org.apache.airavata.persistance.registry.jpa.impl.RegistryFactory;
@@ -1236,4 +1241,37 @@ public class GFacUtils {
 		}
 	}
 
+    public static LOCALSubmission getLocalJobSubmission (String submissionId) throws AppCatalogException{
+        try {
+            AppCatalog appCatalog = AppCatalogFactory.getAppCatalog();
+            return appCatalog.getComputeResource().getLocalJobSubmission(submissionId);
+        }catch (Exception e){
+            String errorMsg = "Error while retrieving local job submission with submission
id : " + submissionId;
+            log.error(errorMsg, e);
+            throw new AppCatalogException(errorMsg, e);
+        }
+    }
+
+    public static UnicoreJobSubmission getUnicoreJobSubmission (String submissionId) throws
AppCatalogException{
+        try {
+            AppCatalog appCatalog = AppCatalogFactory.getAppCatalog();
+            return appCatalog.getComputeResource().getUNICOREJobSubmission(submissionId);
+        }catch (Exception e){
+            String errorMsg = "Error while retrieving local job submission with submission
id : " + submissionId;
+            log.error(errorMsg, e);
+            throw new AppCatalogException(errorMsg, e);
+        }
+    }
+
+    public static UnicoreJobSubmission getJobSubmission (String submissionId) throws AppCatalogException{
+        try {
+            AppCatalog appCatalog = AppCatalogFactory.getAppCatalog();
+            return appCatalog.getComputeResource().getUNICOREJobSubmission(submissionId);
+        }catch (Exception e){
+            String errorMsg = "Error while retrieving local job submission with submission
id : " + submissionId;
+            log.error(errorMsg, e);
+            throw new AppCatalogException(errorMsg, e);
+        }
+    }
+
 }


Mime
View raw message