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 2019/06/03 19:26:51 UTC
[airavata] branch master updated: Deserializing the task before
registering in the participant
This is an automated email from the ASF dual-hosted git repository.
dimuthuupe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git
The following commit(s) were added to refs/heads/master by this push:
new d9228e1 Deserializing the task before registering in the participant
d9228e1 is described below
commit d9228e1540d767df77a3600246b7a6c0fbb86a6b
Author: Dimuthu Wannipurage <di...@gmail.com>
AuthorDate: Mon Jun 3 15:26:43 2019 -0400
Deserializing the task before registering in the participant
---
.../main/java/org/apache/airavata/helix/core/AbstractTask.java | 10 +++++-----
.../airavata/helix/core/participant/HelixParticipant.java | 10 +++++-----
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/modules/airavata-helix/task-core/src/main/java/org/apache/airavata/helix/core/AbstractTask.java b/modules/airavata-helix/task-core/src/main/java/org/apache/airavata/helix/core/AbstractTask.java
index fff9867..ad1ec83 100644
--- a/modules/airavata-helix/task-core/src/main/java/org/apache/airavata/helix/core/AbstractTask.java
+++ b/modules/airavata-helix/task-core/src/main/java/org/apache/airavata/helix/core/AbstractTask.java
@@ -69,17 +69,17 @@ public abstract class AbstractTask extends UserContentStore implements Task {
@Override
public void init(HelixManager manager, String workflowName, String jobName, String taskName) {
- if (participant != null) {
- participant.registerRunningTask(this);
- } else {
- logger.warn("Task with id: " + taskId + " is not registered since the participant is not set");
- }
super.init(manager, workflowName, jobName, taskName);
try {
TaskUtil.deserializeTaskData(this, this.callbackContext.getTaskConfig().getConfigMap());
} catch (IllegalAccessException | InstantiationException e) {
e.printStackTrace();
}
+ if (participant != null) {
+ participant.registerRunningTask(this);
+ } else {
+ logger.warn("Task with id: " + taskId + " is not registered since the participant is not set");
+ }
}
@Override
diff --git a/modules/airavata-helix/task-core/src/main/java/org/apache/airavata/helix/core/participant/HelixParticipant.java b/modules/airavata-helix/task-core/src/main/java/org/apache/airavata/helix/core/participant/HelixParticipant.java
index fbf08f3..378e678 100644
--- a/modules/airavata-helix/task-core/src/main/java/org/apache/airavata/helix/core/participant/HelixParticipant.java
+++ b/modules/airavata-helix/task-core/src/main/java/org/apache/airavata/helix/core/participant/HelixParticipant.java
@@ -62,7 +62,7 @@ public class HelixParticipant<T extends AbstractTask> implements Runnable {
private String taskTypeName;
private List<Class<? extends T>> taskClasses;
- private final List<AbstractTask> runningTasks = Collections.synchronizedList(new ArrayList<AbstractTask>());
+ private final List<String> runningTasks = Collections.synchronizedList(new ArrayList<String>());
public HelixParticipant(List<Class<? extends T>> taskClasses, String taskTypeName) throws ApplicationSettingsException {
@@ -100,13 +100,13 @@ public class HelixParticipant<T extends AbstractTask> implements Runnable {
}
public void registerRunningTask(AbstractTask task) {
- logger.info("Registering Task " + task.getTaskId() + ". Currently available " + runningTasks.size());
- runningTasks.add(task);
+ runningTasks.add(task.getTaskId());
+ logger.info("Registered Task " + task.getTaskId() + ". Currently available " + runningTasks.size());
}
public void unregisterRunningTask(AbstractTask task) {
- logger.info("Un registering Task " + task.getTaskId() + ". Currently available " + runningTasks.size());
- runningTasks.remove(task);
+ runningTasks.remove(task.getTaskId());
+ logger.info("Un registered Task " + task.getTaskId() + ". Currently available " + runningTasks.size());
}
@SuppressWarnings("WeakerAccess")