MAPREDUCE-4093. Improve RM WebApp start up when proxy address is not set (Devaraj K vai bobby)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1328090 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Joseph Evans 2012-04-19 19:42:32 +00:00
parent 5b35f7df64
commit d09cf903ab
2 changed files with 6 additions and 3 deletions

View File

@ -149,6 +149,9 @@ Release 2.0.0 - UNRELEASED
MAPREDUCE-4103. Fix HA docs for changes to shell command fencer args (todd)
MAPREDUCE-4093. Improve RM WebApp start up when proxy address is not set
(Devaraj K vai bobby)
OPTIMIZATIONS
BUG FIXES

View File

@ -443,14 +443,14 @@ protected void startWepApp() {
WebApps.$for("cluster", ApplicationMasterService.class, masterService, "ws").at(
this.conf.get(YarnConfiguration.RM_WEBAPP_ADDRESS,
YarnConfiguration.DEFAULT_RM_WEBAPP_ADDRESS));
String proxyHostAndPort = YarnConfiguration.getProxyHostAndPort(conf);
if(YarnConfiguration.getRMWebAppHostAndPort(conf).
equals(YarnConfiguration.getProxyHostAndPort(conf))) {
equals(proxyHostAndPort)) {
AppReportFetcher fetcher = new AppReportFetcher(conf, getClientRMService());
builder.withServlet(ProxyUriUtils.PROXY_SERVLET_NAME,
ProxyUriUtils.PROXY_PATH_SPEC, WebAppProxyServlet.class);
builder.withAttribute(WebAppProxy.FETCHER_ATTRIBUTE, fetcher);
String proxy = YarnConfiguration.getProxyHostAndPort(conf);
String[] proxyParts = proxy.split(":");
String[] proxyParts = proxyHostAndPort.split(":");
builder.withAttribute(WebAppProxy.PROXY_HOST_ATTRIBUTE, proxyParts[0]);
}