goiri commented on code in PR #5920:
URL: https://github.com/apache/hadoop/pull/5920#discussion_r1315131997


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/Router.java:
##########
@@ -215,16 +217,48 @@ public void startWepApp() {
 
     Builder<Object> builder =
         WebApps.$for("cluster", null, null, "ws").with(conf).at(webAppAddress);
-    if (RouterServerUtil.isRouterWebProxyEnable(conf)) {
-      fetcher = new FedAppReportFetcher(conf);
-      builder.withServlet(ProxyUriUtils.PROXY_SERVLET_NAME, 
ProxyUriUtils.PROXY_PATH_SPEC,
-          WebAppProxyServlet.class);
-      builder.withAttribute(WebAppProxy.FETCHER_ATTRIBUTE, fetcher);
-      String proxyHostAndPort = getProxyHostAndPort(conf);
-      String[] proxyParts = proxyHostAndPort.split(":");
-      builder.withAttribute(WebAppProxy.PROXY_HOST_ATTRIBUTE, proxyParts[0]);
+
+    WebAppContext uiWebAppContext = null;
+    boolean isWebUI2Enabled = 
conf.getBoolean(YarnConfiguration.YARN_WEBAPP_UI2_ENABLE,
+        YarnConfiguration.DEFAULT_YARN_WEBAPP_UI2_ENABLE);
+
+    if(isWebUI2Enabled) {

Review Comment:
   Space after the if



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/Router.java:
##########
@@ -215,16 +217,48 @@ public void startWepApp() {
 
     Builder<Object> builder =
         WebApps.$for("cluster", null, null, "ws").with(conf).at(webAppAddress);
-    if (RouterServerUtil.isRouterWebProxyEnable(conf)) {
-      fetcher = new FedAppReportFetcher(conf);
-      builder.withServlet(ProxyUriUtils.PROXY_SERVLET_NAME, 
ProxyUriUtils.PROXY_PATH_SPEC,
-          WebAppProxyServlet.class);
-      builder.withAttribute(WebAppProxy.FETCHER_ATTRIBUTE, fetcher);
-      String proxyHostAndPort = getProxyHostAndPort(conf);
-      String[] proxyParts = proxyHostAndPort.split(":");
-      builder.withAttribute(WebAppProxy.PROXY_HOST_ATTRIBUTE, proxyParts[0]);
+
+    WebAppContext uiWebAppContext = null;
+    boolean isWebUI2Enabled = 
conf.getBoolean(YarnConfiguration.YARN_WEBAPP_UI2_ENABLE,
+        YarnConfiguration.DEFAULT_YARN_WEBAPP_UI2_ENABLE);
+
+    if(isWebUI2Enabled) {

Review Comment:
   It may make sense to have this whole chunk under a function.



##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/Router.java:
##########
@@ -215,16 +217,48 @@ public void startWepApp() {
 
     Builder<Object> builder =
         WebApps.$for("cluster", null, null, "ws").with(conf).at(webAppAddress);
-    if (RouterServerUtil.isRouterWebProxyEnable(conf)) {
-      fetcher = new FedAppReportFetcher(conf);
-      builder.withServlet(ProxyUriUtils.PROXY_SERVLET_NAME, 
ProxyUriUtils.PROXY_PATH_SPEC,
-          WebAppProxyServlet.class);
-      builder.withAttribute(WebAppProxy.FETCHER_ATTRIBUTE, fetcher);
-      String proxyHostAndPort = getProxyHostAndPort(conf);
-      String[] proxyParts = proxyHostAndPort.split(":");
-      builder.withAttribute(WebAppProxy.PROXY_HOST_ATTRIBUTE, proxyParts[0]);
+
+    WebAppContext uiWebAppContext = null;
+    boolean isWebUI2Enabled = 
conf.getBoolean(YarnConfiguration.YARN_WEBAPP_UI2_ENABLE,
+        YarnConfiguration.DEFAULT_YARN_WEBAPP_UI2_ENABLE);
+
+    if(isWebUI2Enabled) {

Review Comment:
   Which can just return the uiWebAppContext



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to