You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by di...@apache.org on 2018/11/02 02:34:27 UTC

[airavata] branch staging updated: Using MonitoringUtil to monitor paths

This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch staging
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/staging by this push:
     new e642e7f  Using MonitoringUtil to monitor paths
e642e7f is described below

commit e642e7f1e42072bbe63dbd3e357acc8af2a8fa74
Author: Dimuthu Wannipurage <di...@datasprouts.com>
AuthorDate: Thu Nov 1 22:34:17 2018 -0400

    Using MonitoringUtil to monitor paths
---
 .../helix/impl/task/cancel/RemoteJobCancellationTask.java        | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/cancel/RemoteJobCancellationTask.java b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/cancel/RemoteJobCancellationTask.java
index 5ff3a76..889a09d 100644
--- a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/cancel/RemoteJobCancellationTask.java
+++ b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/cancel/RemoteJobCancellationTask.java
@@ -2,6 +2,7 @@ package org.apache.airavata.helix.impl.task.cancel;
 
 import org.apache.airavata.agents.api.AgentAdaptor;
 import org.apache.airavata.agents.api.CommandOutput;
+import org.apache.airavata.helix.core.util.MonitoringUtil;
 import org.apache.airavata.helix.impl.task.AiravataTask;
 import org.apache.airavata.helix.impl.task.TaskContext;
 import org.apache.airavata.helix.impl.task.submission.config.JobFactory;
@@ -16,6 +17,7 @@ import org.apache.helix.task.TaskResult;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.Collections;
 import java.util.List;
 
 @TaskDef(name = "Remote Job Cancellation Task")
@@ -137,11 +139,6 @@ public class RemoteJobCancellationTask extends AiravataTask {
     }
 
     private List<String> getJobsOfProcess(String processId) throws Exception {
-        String path = "/registry/" + processId + "/jobs";
-        if (getCuratorClient().checkExists().forPath(path) != null) {
-            return getCuratorClient().getChildren().forPath(path);
-        } else {
-            return null;
-        }
+        return Collections.singletonList(MonitoringUtil.getJobIdByProcessId(getCuratorClient(), processId));
     }
 }