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
This commit is contained in:
Arun Murthy 2014-04-05 02:51:08 +00:00
parent 4e979f5dea
commit 05da90ee2f
2 changed files with 9 additions and 9 deletions

View File

@ -270,8 +270,14 @@ public void testRMWebAppRedirect() throws YarnException,
String header = getHeader("Refresh", rm2Url); String header = getHeader("Refresh", rm2Url);
assertTrue(header.contains("; url=" + rm1Url)); assertTrue(header.contains("; url=" + rm1Url));
// standby RM links /conf, /stacks, /logLevel, /metrics, /jmx, header = getHeader("Refresh", rm2Url + "/metrics");
// /static, /logs, /cluster/cluster as well as webService 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 // /ws/v1/cluster/info should not be redirected to active RM
header = getHeader("Refresh", rm2Url + "/cluster/cluster"); header = getHeader("Refresh", rm2Url + "/cluster/cluster");
assertEquals(null, header); assertEquals(null, header);
@ -285,12 +291,6 @@ public void testRMWebAppRedirect() throws YarnException,
header = getHeader("Refresh", rm2Url + "/logLevel"); header = getHeader("Refresh", rm2Url + "/logLevel");
assertEquals(null, header); assertEquals(null, header);
header = getHeader("Refresh", rm2Url + "/metrics");
assertEquals(null, header);
header = getHeader("Refresh", rm2Url + "/jmx");
assertEquals(null, header);
header = getHeader("Refresh", rm2Url + "/static"); header = getHeader("Refresh", rm2Url + "/static");
assertEquals(null, header); assertEquals(null, header);

View File

@ -46,7 +46,7 @@ public class RMWebAppFilter extends GuiceContainer {
// define a set of URIs which do not need to do redirection // define a set of URIs which do not need to do redirection
private static final Set<String> NON_REDIRECTED_URIS = Sets.newHashSet( private static final Set<String> NON_REDIRECTED_URIS = Sets.newHashSet(
"/conf", "/stacks", "/logLevel", "/metrics", "/jmx", "/logs"); "/conf", "/stacks", "/logLevel", "/logs");
@Inject @Inject
public RMWebAppFilter(Injector injector) { public RMWebAppFilter(Injector injector) {