Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 38E9D17691 for ; Thu, 30 Oct 2014 21:06:20 +0000 (UTC) Received: (qmail 50302 invoked by uid 500); 30 Oct 2014 21:06:20 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 50258 invoked by uid 500); 30 Oct 2014 21:06:20 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 50248 invoked by uid 99); 30 Oct 2014 21:06:20 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Oct 2014 21:06:20 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id BF52A984666; Thu, 30 Oct 2014 21:06:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chathuri@apache.org To: commits@airavata.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: adding util methods to get job submission Date: Thu, 30 Oct 2014 21:06:19 +0000 (UTC) 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 Authored: Thu Oct 30 17:06:06 2014 -0400 Committer: Chathuri Wimalasena 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 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 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); + } + } + }