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/branches/branch-2@1328091 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Joseph Evans 2012-04-19 19:44:55 +00:00
parent eec2fd9f74
commit e439d3bb39
2 changed files with 6 additions and 3 deletions

View File

@ -45,6 +45,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]);
}