YARN-3359. Addendum for Recover collector list when RM fails over (Li Lu via Varun Saxena)

(cherry picked from commit 25b19178dd53bc0d57ca5fd64d3464af7b59e588)

Conflicts:
	hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java
This commit is contained in:
Varun Saxena 2016-11-08 04:01:37 +05:30
parent 484b1d2ec1
commit 684c2d149f
3 changed files with 14 additions and 9 deletions

View File

@ -70,14 +70,14 @@ public interface Context {
* @return registering collectors, or null if the timeline service v.2 is not
* enabled
*/
Map<ApplicationId, AppCollectorData> getRegisteringCollectors();
ConcurrentMap<ApplicationId, AppCollectorData> 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<ApplicationId, AppCollectorData> getKnownCollectors();
ConcurrentMap<ApplicationId, AppCollectorData> getKnownCollectors();
ConcurrentMap<ContainerId, Container> getContainers();

View File

@ -529,7 +529,7 @@ public class NodeManager extends CompositeService
if (knownCollectors == null) {
return;
}
Map<ApplicationId, AppCollectorData> registeringCollectors
ConcurrentMap<ApplicationId, AppCollectorData> registeringCollectors
= context.getRegisteringCollectors();
for (Map.Entry<ApplicationId, AppCollectorData> entry
: knownCollectors.entrySet()) {
@ -566,9 +566,10 @@ public class NodeManager extends CompositeService
protected final ConcurrentMap<ContainerId, Container> containers =
new ConcurrentSkipListMap<ContainerId, Container>();
private Map<ApplicationId, AppCollectorData> registeringCollectors;
private ConcurrentMap<ApplicationId, AppCollectorData>
registeringCollectors;
private Map<ApplicationId, AppCollectorData> knownCollectors;
private ConcurrentMap<ApplicationId, AppCollectorData> knownCollectors;
protected final ConcurrentMap<ContainerId,
org.apache.hadoop.yarn.api.records.Container> increasedContainers =
@ -779,12 +780,13 @@ public class NodeManager extends CompositeService
this.containerStateTransitionListener = transitionListener;
}
public Map<ApplicationId, AppCollectorData> getRegisteringCollectors() {
public ConcurrentMap<ApplicationId, AppCollectorData>
getRegisteringCollectors() {
return this.registeringCollectors;
}
@Override
public Map<ApplicationId, AppCollectorData> getKnownCollectors() {
public ConcurrentMap<ApplicationId, AppCollectorData> getKnownCollectors() {
return this.knownCollectors;
}

View File

@ -661,11 +661,14 @@ public abstract class BaseAMRMProxyTest {
return null;
}
public Map<ApplicationId, AppCollectorData> getRegisteringCollectors() {
@Override
public ConcurrentMap<ApplicationId, AppCollectorData>
getRegisteringCollectors() {
return null;
}
@Override public Map<ApplicationId, AppCollectorData> getKnownCollectors() {
@Override
public ConcurrentMap<ApplicationId, AppCollectorData> getKnownCollectors() {
return null;
}