YARN-2599. Standby RM should expose jmx endpoint. Contributed by Rohith Sharma K S.

This commit is contained in:
Sunil G 2019-08-17 15:43:19 +05:30
parent 8d754c2c39
commit 0e0ddfaf24
2 changed files with 7 additions and 5 deletions

View File

@ -294,10 +294,8 @@ public class TestRMFailover extends ClientBaseWithFixes {
redirectURL = getRedirectURL(rm2Url + "/metrics");
assertEquals(redirectURL,rm1Url + "/metrics");
redirectURL = getRedirectURL(rm2Url + "/jmx?param1=value1+x&param2=y");
assertEquals(rm1Url + "/jmx?param1=value1+x&param2=y", redirectURL);
// standby RM links /conf, /stacks, /logLevel, /static, /logs,
// standby RM links /conf, /stacks, /logLevel, /static, /logs, /jmx
// /cluster/cluster as well as webService
// /ws/v1/cluster/info should not be redirected to active RM
redirectURL = getRedirectURL(rm2Url + "/cluster/cluster");
@ -318,6 +316,9 @@ public class TestRMFailover extends ClientBaseWithFixes {
redirectURL = getRedirectURL(rm2Url + "/logs");
assertNull(redirectURL);
redirectURL = getRedirectURL(rm2Url + "/jmx?param1=value1+x&param2=y");
assertNull(redirectURL);
redirectURL = getRedirectURL(rm2Url + "/ws/v1/cluster/info");
assertNull(redirectURL);

View File

@ -69,7 +69,8 @@ public class RMWebAppFilter extends GuiceContainer {
// define a set of URIs which do not need to do redirection
private static final Set<String> NON_REDIRECTED_URIS = Sets.newHashSet(
"/conf", "/stacks", "/logLevel", "/logs", IsActiveServlet.PATH_SPEC);
"/conf", "/stacks", "/logLevel", "/logs", IsActiveServlet.PATH_SPEC,
"/jmx");
private String path;
private boolean ahsEnabled;
private String ahsPageURLPrefix;
@ -274,4 +275,4 @@ public class RMWebAppFilter extends GuiceContainer {
long baseTime = BASIC_SLEEP_TIME * (1L << retries);
return (int) (baseTime * (randnum.nextDouble() + 0.5));
}
}
}