From 2eab7a28c786560717dd19ddb91a0fb2b0a9db81 Mon Sep 17 00:00:00 2001 From: Arun Murthy Date: Sat, 17 Sep 2011 05:52:49 +0000 Subject: [PATCH] MAPREDUCE-2987. Fixed display of logged user on RM Web-UI. Contributed by Thomas Graves. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1171901 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../org/apache/hadoop/yarn/webapp/view/HeaderBlock.java | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 68341f0458..bedeeb86c6 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -1336,6 +1336,9 @@ Release 0.23.0 - Unreleased MAPREDUCE-3007. Fixed Yarn Mapreduce client to be able to connect to JobHistoryServer in secure mode. (vinodkv) + MAPREDUCE-2987. Fixed display of logged user on RM Web-UI. (Thomas Graves + via acmurthy) + Release 0.22.0 - Unreleased INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/view/HeaderBlock.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/view/HeaderBlock.java index d03d2d24d9..ee305a6f84 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/view/HeaderBlock.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/view/HeaderBlock.java @@ -23,10 +23,14 @@ public class HeaderBlock extends HtmlBlock { @Override protected void render(Block html) { + String loggedIn = ""; + if (request().getRemoteUser() != null) { + loggedIn = "Logged in as: " + request().getRemoteUser(); + } html. div("#header.ui-widget"). div("#user"). - _("Logged in as: "+ request().getRemoteUser())._(). + _(loggedIn)._(). div("#logo"). img("/static/hadoop-st.png")._(). h1($(TITLE))._();