YARN-1382. Remove unusableRMNodesConcurrentSet (never used) in NodeListManager to get rid of memory leak. Contributed by Rohith Sharma K S.
This commit is contained in:
parent
ad997fab67
commit
223ce323bb
@ -1202,6 +1202,9 @@ Release 2.8.0 - UNRELEASED
|
|||||||
YARN-4400. AsyncDispatcher.waitForDrained should be final. (Daniel Templeton
|
YARN-4400. AsyncDispatcher.waitForDrained should be final. (Daniel Templeton
|
||||||
via junping_du)
|
via junping_du)
|
||||||
|
|
||||||
|
YARN-1382. Remove unusableRMNodesConcurrentSet (never used) in NodeListManager
|
||||||
|
to get rid of memory leak. (Rohith Sharma K S via junping_du)
|
||||||
|
|
||||||
Release 2.7.3 - UNRELEASED
|
Release 2.7.3 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
@ -19,8 +19,6 @@
|
|||||||
package org.apache.hadoop.yarn.server.resourcemanager;
|
package org.apache.hadoop.yarn.server.resourcemanager;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -62,9 +60,6 @@ public class NodesListManager extends CompositeService implements
|
|||||||
|
|
||||||
private HostsFileReader hostsReader;
|
private HostsFileReader hostsReader;
|
||||||
private Configuration conf;
|
private Configuration conf;
|
||||||
private Set<RMNode> unusableRMNodesConcurrentSet = Collections
|
|
||||||
.newSetFromMap(new ConcurrentHashMap<RMNode,Boolean>());
|
|
||||||
|
|
||||||
private final RMContext rmContext;
|
private final RMContext rmContext;
|
||||||
|
|
||||||
private String includesFile;
|
private String includesFile;
|
||||||
@ -290,24 +285,12 @@ public boolean isValidNode(String hostName) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides the currently unusable nodes. Copies it into provided collection.
|
|
||||||
* @param unUsableNodes
|
|
||||||
* Collection to which the unusable nodes are added
|
|
||||||
* @return number of unusable nodes added
|
|
||||||
*/
|
|
||||||
public int getUnusableNodes(Collection<RMNode> unUsableNodes) {
|
|
||||||
unUsableNodes.addAll(unusableRMNodesConcurrentSet);
|
|
||||||
return unusableRMNodesConcurrentSet.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handle(NodesListManagerEvent event) {
|
public void handle(NodesListManagerEvent event) {
|
||||||
RMNode eventNode = event.getNode();
|
RMNode eventNode = event.getNode();
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case NODE_UNUSABLE:
|
case NODE_UNUSABLE:
|
||||||
LOG.debug(eventNode + " reported unusable");
|
LOG.debug(eventNode + " reported unusable");
|
||||||
unusableRMNodesConcurrentSet.add(eventNode);
|
|
||||||
for(RMApp app: rmContext.getRMApps().values()) {
|
for(RMApp app: rmContext.getRMApps().values()) {
|
||||||
if (!app.isAppFinalStateStored()) {
|
if (!app.isAppFinalStateStored()) {
|
||||||
this.rmContext
|
this.rmContext
|
||||||
@ -320,10 +303,7 @@ public void handle(NodesListManagerEvent event) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NODE_USABLE:
|
case NODE_USABLE:
|
||||||
if (unusableRMNodesConcurrentSet.contains(eventNode)) {
|
|
||||||
LOG.debug(eventNode + " reported usable");
|
LOG.debug(eventNode + " reported usable");
|
||||||
unusableRMNodesConcurrentSet.remove(eventNode);
|
|
||||||
}
|
|
||||||
for (RMApp app : rmContext.getRMApps().values()) {
|
for (RMApp app : rmContext.getRMApps().values()) {
|
||||||
if (!app.isAppFinalStateStored()) {
|
if (!app.isAppFinalStateStored()) {
|
||||||
this.rmContext
|
this.rmContext
|
||||||
|
Loading…
Reference in New Issue
Block a user