diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/Context.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/Context.java index aab2edfc90b..33cefea91f5 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/Context.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/Context.java @@ -70,14 +70,14 @@ public interface Context { * @return registering collectors, or null if the timeline service v.2 is not * enabled */ - Map getRegisteringCollectors(); + ConcurrentMap getRegisteringCollectors(); /** * Get the list of collectors registered with the RM and known by this node. * @return known collectors, or null if the timeline service v.2 is not * enabled. */ - Map getKnownCollectors(); + ConcurrentMap getKnownCollectors(); ConcurrentMap getContainers(); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java index c087126693e..c23c071920a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java @@ -529,7 +529,7 @@ public class NodeManager extends CompositeService if (knownCollectors == null) { return; } - Map registeringCollectors + ConcurrentMap registeringCollectors = context.getRegisteringCollectors(); for (Map.Entry entry : knownCollectors.entrySet()) { @@ -566,9 +566,10 @@ public class NodeManager extends CompositeService protected final ConcurrentMap containers = new ConcurrentSkipListMap(); - private Map registeringCollectors; + private ConcurrentMap + registeringCollectors; - private Map knownCollectors; + private ConcurrentMap knownCollectors; protected final ConcurrentMap increasedContainers = @@ -779,12 +780,13 @@ public class NodeManager extends CompositeService this.containerStateTransitionListener = transitionListener; } - public Map getRegisteringCollectors() { + public ConcurrentMap + getRegisteringCollectors() { return this.registeringCollectors; } @Override - public Map getKnownCollectors() { + public ConcurrentMap getKnownCollectors() { return this.knownCollectors; } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/BaseAMRMProxyTest.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/BaseAMRMProxyTest.java index a51878fe0a3..3afbce76d56 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/BaseAMRMProxyTest.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/BaseAMRMProxyTest.java @@ -661,11 +661,14 @@ public abstract class BaseAMRMProxyTest { return null; } - public Map getRegisteringCollectors() { + @Override + public ConcurrentMap + getRegisteringCollectors() { return null; } - @Override public Map getKnownCollectors() { + @Override + public ConcurrentMap getKnownCollectors() { return null; }