airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject [46/50] [abbrv] airavata git commit: fixing schedular class to get correct execution mode
Date Tue, 11 Nov 2014 20:12:50 GMT
fixing schedular class to get correct execution mode


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

Branch: refs/heads/master
Commit: 225b6746f40d66d6335b590038bf273cb5ed5c7b
Parents: 62f0036
Author: chathuriw <kamalasini@gmail.com>
Authored: Fri Nov 7 14:53:09 2014 -0500
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Fri Nov 7 14:53:09 2014 -0500

----------------------------------------------------------------------
 .../src/main/java/org/apache/airavata/gfac/Scheduler.java   | 9 +++++++++
 .../org/apache/airavata/gfac/monitor/HostMonitorData.java   | 8 ++++++++
 2 files changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/225b6746/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 0dae029..fb5899d 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
@@ -182,6 +182,7 @@ public class Scheduler {
         DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
         DocumentBuilder docBuilder = null;
         Document handlerDoc = null;
+        String jobSubmissionProtocol = jobExecutionContext.getPreferredJobSubmissionProtocol().toString();
         try {
             docBuilder = docBuilderFactory.newDocumentBuilder();
             handlerDoc = docBuilder.parse(new File(resource.getPath()));
@@ -203,6 +204,14 @@ public class Scheduler {
                 String hostClass = jobExecutionContext.getPreferredJobSubmissionProtocol().toString();
                 executionMode = GFacConfiguration.getAttributeValue(GFacConfiguration.getHandlerDoc(),
Constants.XPATH_EXPR_PROVIDER_ON_HOST + hostClass + "']", Constants.GFAC_CONFIG_EXECUTION_MODE_ATTRIBUTE);
             }
+
+            if (executionMode == null || "".equals(executionMode)) {
+                List<Element> elements = GFacUtils.getElementList(GFacConfiguration.getHandlerDoc(),
Constants.XPATH_EXPR_PROVIDER_ON_SUBMISSION + jobSubmissionProtocol + "']");
+                for (Element element : elements) {
+                    executionMode = element.getAttribute(Constants.GFAC_CONFIG_EXECUTION_MODE_ATTRIBUTE);
+                }
+            }
+
         } catch (XPathExpressionException e) {
             log.error("Error evaluating XPath expression");  //To change body of catch statement
use File | Settings | File Templates.
             throw new GFacException("Error evaluating XPath expression", e);

http://git-wip-us.apache.org/repos/asf/airavata/blob/225b6746/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HostMonitorData.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HostMonitorData.java
b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HostMonitorData.java
index c2017a0..f29e3e6 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HostMonitorData.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HostMonitorData.java
@@ -27,6 +27,7 @@ import org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescr
 import org.apache.airavata.model.appcatalog.computeresource.DataMovementProtocol;
 import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionProtocol;
 
+import java.util.ArrayList;
 import java.util.List;
 
 public class HostMonitorData {
@@ -41,7 +42,14 @@ public class HostMonitorData {
         this.computeResourceDescription = jobExecutionContext.getApplicationContext().getComputeResourceDescription();
         this.jobSubmissionProtocol = jobExecutionContext.getPreferredJobSubmissionProtocol();
         this.dataMovementProtocol = jobExecutionContext.getPreferredDataMovementProtocol();
+        this.monitorIDs = new ArrayList<MonitorID>();
+    }
 
+    public HostMonitorData(JobExecutionContext jobExecutionContext, List<MonitorID>
monitorIDs) {
+        this.computeResourceDescription = jobExecutionContext.getApplicationContext().getComputeResourceDescription();
+        this.jobSubmissionProtocol = jobExecutionContext.getPreferredJobSubmissionProtocol();
+        this.dataMovementProtocol = jobExecutionContext.getPreferredDataMovementProtocol();
+        this.monitorIDs = monitorIDs;
     }
 
     public ComputeResourceDescription getComputeResourceDescription() {


Mime
View raw message