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/11/11 21:12:17 UTC
[13/50] [abbrv] airavata git commit: adding util methods to get job
submission
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/51361579
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/51361579
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/51361579
Branch: refs/heads/master
Commit: 51361579602458f56e9b70250c76397305941696
Parents: e28919c
Author: chathuriw <ka...@gmail.com>
Authored: Thu Oct 30 17:06:06 2014 -0400
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Wed Nov 5 11:16:15 2014 -0500
----------------------------------------------------------------------
.../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/51361579/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/51361579/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/51361579/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 ce74e4e..ff6f2c2 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;
@@ -1237,4 +1242,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);
+ }
+ }
+
}