You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2018/02/01 20:53:38 UTC
[3/4] storm git commit: Addressed review comments
Addressed review comments
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/77be31bc
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/77be31bc
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/77be31bc
Branch: refs/heads/master
Commit: 77be31bc4533cb9437242261ff89d1a750eef5c4
Parents: 48c2fda
Author: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Authored: Wed Jan 31 10:17:43 2018 -0600
Committer: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Committed: Wed Jan 31 10:17:43 2018 -0600
----------------------------------------------------------------------
.../apache/storm/daemon/supervisor/OnlyLatestExecutor.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/77be31bc/storm-server/src/main/java/org/apache/storm/daemon/supervisor/OnlyLatestExecutor.java
----------------------------------------------------------------------
diff --git a/storm-server/src/main/java/org/apache/storm/daemon/supervisor/OnlyLatestExecutor.java b/storm-server/src/main/java/org/apache/storm/daemon/supervisor/OnlyLatestExecutor.java
index bd73766..7dc9b0b 100644
--- a/storm-server/src/main/java/org/apache/storm/daemon/supervisor/OnlyLatestExecutor.java
+++ b/storm-server/src/main/java/org/apache/storm/daemon/supervisor/OnlyLatestExecutor.java
@@ -21,12 +21,15 @@ package org.apache.storm.daemon.supervisor;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.Executor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* This allows you to submit a Runnable with a key. If the previous submission for that key has not yet run,
* it will be replaced with the latest one.
*/
public class OnlyLatestExecutor<K> {
+ private static final Logger LOG = LoggerFactory.getLogger(OnlyLatestExecutor.class);
private final Executor exec;
private final ConcurrentMap<K, Runnable> latest;
@@ -47,9 +50,11 @@ public class OnlyLatestExecutor<K> {
exec.execute(() -> {
Runnable run = latest.remove(key);
if (run != null) {
- run.run();;
+ run.run();
}
});
- }
+ } else {
+ LOG.debug("Replacing runnable for {} - {}", key, r);
+ }
}
}