From 05da90ee2f8e58d836af2246a226e728475b23da Mon Sep 17 00:00:00 2001 From: Arun Murthy Date: Sat, 5 Apr 2014 02:51:08 +0000 Subject: [PATCH] YARN-1898. Addendum patch to ensure /jmx and /metrics are re-directed to Active RM. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1584954 13f79535-47bb-0310-9956-ffa450edef68 --- .../hadoop/yarn/client/TestRMFailover.java | 16 ++++++++-------- .../resourcemanager/webapp/RMWebAppFilter.java | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java index 1ee54e898a..273a3b9b3f 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java @@ -270,8 +270,14 @@ public void testRMWebAppRedirect() throws YarnException, String header = getHeader("Refresh", rm2Url); assertTrue(header.contains("; url=" + rm1Url)); - // standby RM links /conf, /stacks, /logLevel, /metrics, /jmx, - // /static, /logs, /cluster/cluster as well as webService + header = getHeader("Refresh", rm2Url + "/metrics"); + assertTrue(header.contains("; url=" + rm1Url)); + + header = getHeader("Refresh", rm2Url + "/jmx"); + assertTrue(header.contains("; url=" + rm1Url)); + + // standby RM links /conf, /stacks, /logLevel, /static, /logs, + // /cluster/cluster as well as webService // /ws/v1/cluster/info should not be redirected to active RM header = getHeader("Refresh", rm2Url + "/cluster/cluster"); assertEquals(null, header); @@ -285,12 +291,6 @@ public void testRMWebAppRedirect() throws YarnException, header = getHeader("Refresh", rm2Url + "/logLevel"); assertEquals(null, header); - header = getHeader("Refresh", rm2Url + "/metrics"); - assertEquals(null, header); - - header = getHeader("Refresh", rm2Url + "/jmx"); - assertEquals(null, header); - header = getHeader("Refresh", rm2Url + "/static"); assertEquals(null, header); 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/RMWebAppFilter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java index 653432b8a9..49fd1f54de 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java @@ -46,7 +46,7 @@ public class RMWebAppFilter extends GuiceContainer { // define a set of URIs which do not need to do redirection private static final Set NON_REDIRECTED_URIS = Sets.newHashSet( - "/conf", "/stacks", "/logLevel", "/metrics", "/jmx", "/logs"); + "/conf", "/stacks", "/logLevel", "/logs"); @Inject public RMWebAppFilter(Injector injector) {