YARN-6801. NPE in RM while setting collectors map in NodeHeartbeatResponse. Contributed by Vrushali C.
(cherry picked from commit 5791ced4bd864ff6c08cb2c3ee10ab62008f0168)
This commit is contained in:
parent
82de1fd84a
commit
d01a3f1ba2
|
@ -620,13 +620,17 @@ public class ResourceTrackerService extends AbstractService implements
|
|||
Map<ApplicationId, RMApp> rmApps = rmContext.getRMApps();
|
||||
// Set collectors for all running apps on this node.
|
||||
for (ApplicationId appId : runningApps) {
|
||||
AppCollectorData appCollectorData = rmApps.get(appId).getCollectorData();
|
||||
if (appCollectorData != null) {
|
||||
liveAppCollectorsMap.put(appId, appCollectorData);
|
||||
} else {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Collector for applicaton: " + appId +
|
||||
" hasn't registered yet!");
|
||||
RMApp app = rmApps.get(appId);
|
||||
if (app != null) {
|
||||
AppCollectorData appCollectorData = rmApps.get(appId)
|
||||
.getCollectorData();
|
||||
if (appCollectorData != null) {
|
||||
liveAppCollectorsMap.put(appId, appCollectorData);
|
||||
} else {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Collector for applicaton: " + appId +
|
||||
" hasn't registered yet!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue