From e4059b9cce2703c412abeacc08225c3cdfe415c1 Mon Sep 17 00:00:00 2001 From: Zhijie Shen Date: Wed, 1 Apr 2015 13:47:54 -0700 Subject: [PATCH] YARN-3430. Made headroom data available on app attempt page of RM WebUI. Contributed by Xuan Gong. (cherry picked from commit 8366a36ad356e6318b8ce6c5c96e201149f811bd) --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../yarn/server/resourcemanager/webapp/RMAppAttemptBlock.java | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index c40da6dc5c5..c0ba02917f0 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -745,6 +745,9 @@ Release 2.7.0 - UNRELEASED removing inconsistencies in the default values. (Junping Du and Karthik Kambatla via vinodkv) + YARN-3430. Made headroom data available on app attempt page of RM WebUI. + (Xuan Gong via zjshen) + Release 2.6.0 - 2014-11-18 INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMAppAttemptBlock.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMAppAttemptBlock.java index 419c0ce6753..b5195812686 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMAppAttemptBlock.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMAppAttemptBlock.java @@ -156,10 +156,12 @@ public class RMAppAttemptBlock extends AppAttemptBlock{ if (attempt != null) { if (!isApplicationInFinalState(YarnApplicationAttemptState .valueOf(attempt.getAppAttemptState().toString()))) { + RMAppAttemptMetrics metrics = attempt.getRMAppAttemptMetrics(); DIV pdiv = html._(InfoBlock.class).div(_INFO_WRAP); info("Application Attempt Overview").clear(); info("Application Attempt Metrics")._( - "Application Attempt Headroom : ", 0); + "Application Attempt Headroom : ", metrics == null ? "N/A" : + metrics.getApplicationAttemptHeadroom()); pdiv._(); } }