vanzin commented on a change in pull request #24088: [SPARK-27122][core] Jetty 
classes must not be return via getters in org.apache.spark.ui.WebUI
URL: https://github.com/apache/spark/pull/24088#discussion_r265725434
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/ui/WebUI.scala
 ##########
 @@ -193,3 +209,30 @@ private[spark] abstract class WebUIPage(var prefix: 
String) {
   def render(request: HttpServletRequest): Seq[Node]
   def renderJson(request: HttpServletRequest): JValue = JNothing
 }
+
+private[spark] class DelegatingServletContextHandler(servletContextHandler: 
ServletContextHandler) {
+
+  def prependFilterMapping(filterName: String,
+                           spec: String,
+                           types: EnumSet[DispatcherType]): Unit = {
+    val mapping = new FilterMapping()
+    mapping.setFilterName(filterName)
+    mapping.setPathSpec(spec)
+    mapping.setDispatcherTypes(EnumSet.allOf(classOf[DispatcherType]))
+    servletContextHandler.getServletHandler.prependFilterMapping(mapping)
+  }
+
+  def addFilter(filterName: String,
+                className: String,
+                filterParams: Map[String, String]): Unit = {
+    val filterHolder = new FilterHolder()
+    filterHolder.setName(filterName)
+    filterHolder.setClassName(className)
+    filterParams.foreach { case (k, v) => filterHolder.setInitParameter(k, v) }
+    servletContextHandler.getServletHandler.addFilter(filterHolder)
+  }
+
+  def filterSize(): Int = {
 
 Review comment:
   `filterCount`

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to