BasicExecutionManager tidy: use Set instead of Map For incompleteTaskIds
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/182e2e3a Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/182e2e3a Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/182e2e3a Branch: refs/heads/master Commit: 182e2e3a9f2994b0e343f78443e008684193539f Parents: 2862a39 Author: Aled Sage <[email protected]> Authored: Wed Mar 30 00:06:56 2016 +0100 Committer: Aled Sage <[email protected]> Committed: Wed Mar 30 00:06:56 2016 +0100 ---------------------------------------------------------------------- .../apache/brooklyn/util/core/task/BasicExecutionManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/182e2e3a/core/src/main/java/org/apache/brooklyn/util/core/task/BasicExecutionManager.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/brooklyn/util/core/task/BasicExecutionManager.java b/core/src/main/java/org/apache/brooklyn/util/core/task/BasicExecutionManager.java index ee15bec..8f43827 100644 --- a/core/src/main/java/org/apache/brooklyn/util/core/task/BasicExecutionManager.java +++ b/core/src/main/java/org/apache/brooklyn/util/core/task/BasicExecutionManager.java @@ -70,6 +70,7 @@ import com.google.common.base.CaseFormat; import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; +import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.google.common.util.concurrent.ExecutionList; import com.google.common.util.concurrent.ListenableFuture; @@ -118,7 +119,7 @@ public class BasicExecutionManager implements ExecutionManager { private final AtomicLong totalTaskCount = new AtomicLong(); /** tasks submitted but not yet done (or in cases of interruption/cancelled not yet GC'd) */ - private Map<String,String> incompleteTaskIds = new ConcurrentHashMap<String,String>(); + private Set<String> incompleteTaskIds = Sets.newConcurrentHashSet(); /** tasks started but not yet finished */ private final AtomicInteger activeTaskCount = new AtomicInteger(); @@ -717,7 +718,7 @@ public class BasicExecutionManager implements ExecutionManager { } /** invoked when a task is submitted */ protected void internalBeforeSubmit(Map<?,?> flags, Task<?> task) { - incompleteTaskIds.put(task.getId(), task.getId()); + incompleteTaskIds.add(task.getId()); Task<?> currentTask = Tasks.current(); if (currentTask!=null) ((TaskInternal<?>)task).setSubmittedByTask(currentTask);
