From 44eb4c31b84e89356574c01c649a9d4545027d59 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Vavilapalli Date: Wed, 13 Mar 2013 04:24:35 +0000 Subject: [PATCH] YARN-198. Added a link to RM pages from the NodeManager web app. Contributed by Jian He. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1455800 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../yarn/server/nodemanager/NodeManager.java | 2 +- .../server/nodemanager/webapp/NavBlock.java | 22 ++++++++++++++++--- .../server/nodemanager/webapp/NodePage.java | 2 +- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index fbf6261b422..b3e28a8eef8 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -66,6 +66,9 @@ Release 2.0.5-beta - UNRELEASED the per-application page are translated to html line breaks. (Omkar Vinit Joshi via vinodkv) + YARN-198. Added a link to RM pages from the NodeManager web app. (Jian He + via vinodkv) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java index 7d370cdd9f7..5aa947f32b8 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java @@ -350,7 +350,7 @@ public class NodeManager extends CompositeService ContainerManagerImpl getContainerManager() { return containerManager; } - + public static void main(String[] args) { Thread.setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler()); StringUtils.startupShutdownMessage(NodeManager.class, args, LOG); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NavBlock.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NavBlock.java index 7ee469c620f..73511c45145 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NavBlock.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NavBlock.java @@ -18,16 +18,32 @@ package org.apache.hadoop.yarn.server.nodemanager.webapp; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.webapp.YarnWebParams; import org.apache.hadoop.yarn.webapp.view.HtmlBlock; +import com.google.inject.Inject; + public class NavBlock extends HtmlBlock implements YarnWebParams { + private Configuration conf; + + @Inject + public NavBlock(Configuration conf) { + this.conf = conf; + } + @Override protected void render(Block html) { - html + + String RMWebAppURL = YarnConfiguration.getRMWebAppURL(this.conf); + html .div("#nav") - .h3()._("NodeManager")._() // TODO: Problem if no header like this + .h3()._("ResourceManager")._() + .ul() + .li().a(RMWebAppURL, "RM Home")._()._() + .h3()._("NodeManager")._() // TODO: Problem if no header like this .ul() .li() .a(url("node"), "Node Information")._() @@ -37,7 +53,7 @@ public class NavBlock extends HtmlBlock implements YarnWebParams { .li() .a(url("allContainers"), "List of Containers")._() ._() - .h3("Tools") + .h3("Tools") .ul() .li().a("/conf", "Configuration")._() .li().a("/logs", "Local logs")._() diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NodePage.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NodePage.java index 9eb3599f829..9decac62286 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NodePage.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/webapp/NodePage.java @@ -42,7 +42,7 @@ public class NodePage extends NMView { protected void commonPreHead(HTML<_> html) { super.commonPreHead(html); - set(initID(ACCORDION, "nav"), "{autoHeight:false, active:0}"); + set(initID(ACCORDION, "nav"), "{autoHeight:false, active:1}"); } @Override