YARN-3751. Fixed AppInfo to check if used resources are null. Contributed by Sunil G.

(cherry picked from commit dbc4f64937)
This commit is contained in:
Zhijie Shen 2015-06-03 11:51:41 -07:00
parent 539ff92c2a
commit aaa567514a
2 changed files with 11 additions and 6 deletions

View File

@ -431,6 +431,9 @@ Release 2.8.0 - UNRELEASED
YARN-3740. Fixed the typo in the configuration name:
APPLICATION_HISTORY_PREFIX_MAX_APPS. (Xuan Gong via zjshen)
YARN-3751. Fixed AppInfo to check if used resources are null. (Sunil G via
zjshen)
Release 2.7.1 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -86,13 +86,15 @@ public class AppInfo {
elapsedTime = Times.elapsed(startedTime, finishedTime);
finalAppStatus = app.getFinalApplicationStatus();
if (app.getApplicationResourceUsageReport() != null) {
runningContainers =
app.getApplicationResourceUsageReport().getNumUsedContainers();
runningContainers = app.getApplicationResourceUsageReport()
.getNumUsedContainers();
if (app.getApplicationResourceUsageReport().getUsedResources() != null) {
allocatedCpuVcores = app.getApplicationResourceUsageReport()
.getUsedResources().getVirtualCores();
allocatedMemoryMB = app.getApplicationResourceUsageReport()
.getUsedResources().getMemory();
}
}
progress = app.getProgress() * 100; // in percent
if (app.getApplicationTags() != null && !app.getApplicationTags().isEmpty()) {
this.applicationTags = CSV_JOINER.join(app.getApplicationTags());