pan3793 commented on code in PR #46611:

@@ -0,0 +1,256 @@
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.spark.deploy.yarn
+import{HttpURLConnection, InetAddress, MalformedURLException, 
UnknownHostException, URL}
+import java.util.concurrent.TimeUnit
+import jakarta.servlet.{Filter, FilterChain, FilterConfig, ServletException, 
ServletRequest, ServletResponse}
+import jakarta.servlet.http.{HttpServletRequest, HttpServletRequestWrapper, 
+import org.apache.commons.lang3.StringUtils
+import org.apache.spark.internal.Logging
+// This class is inspired by 

Review Comment:
   I was consider to port the code as-is(also keeping package and class name) 
as we did in the `thriftserver` module for `hive-service`, while it would cause 
class conflicts because `hadoop-client-minicluster`(present in test scope) 
ships those classes too. Meanwhile, I found an existing 
`YarnProxyRedirectFilter` which is much simpler and is not coupled with Hadoop 
classes. So I rename the class to `YarnAMIpFilter`, and put it alongside 
`YarnProxyRedirectFilter`. A UT `YarnAMIpFilterSuite` is ported too to ensure 
the correctness of rewriting.
   @cloud-fan if we pursue sync with Hadoop upstream, I can convert it back to 
Java classes, and reuse the Hadoop code as much as possible. For example, use 
`org.apache.hadoop.yarn.webapp.hamlet2.Hamlet` to construct the HTML page in 
`sendRedirect` instead of writing by hand as we did in 

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:

For queries about this service, please contact Infrastructure at:

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to