File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed
core/src/main/scala/org/apache/spark
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,6 @@ class HistoryServer(
152152 assert(serverInfo.isDefined, " HistoryServer must be bound before attaching SparkUIs" )
153153 handlers.synchronized {
154154 ui.getHandlers.foreach(attachHandler)
155- addFilters(ui.getHandlers, conf)
156155 }
157156 }
158157
Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ private[spark] object JettyUtils extends Logging {
263263 filters.foreach {
264264 case filter : String =>
265265 if (! filter.isEmpty) {
266- logInfo(" Adding filter: " + filter )
266+ logInfo(s " Adding filter $filter to ${handlers.map(_.getContextPath).mkString( " , " )} . " )
267267 val holder : FilterHolder = new FilterHolder ()
268268 holder.setClassName(filter)
269269 // Get any parameters for each filter
Original file line number Diff line number Diff line change @@ -93,7 +93,12 @@ private[spark] abstract class WebUI(
9393 /** Attach a handler to this UI. */
9494 def attachHandler (handler : ServletContextHandler ) {
9595 handlers += handler
96- serverInfo.foreach(_.addHandler(handler))
96+ serverInfo.foreach { sInfo =>
97+ sInfo.addHandler(handler)
98+ // If the UI has already been bound, we need to add the filters to the newly attached
99+ // handlers. Otherwise, they will be attached when binding.
100+ addFilters(Seq (handler), conf)
101+ }
97102 }
98103
99104 /** Detach a handler from this UI. */
Original file line number Diff line number Diff line change @@ -39,10 +39,6 @@ private[thriftserver] class ThriftServerTab(sparkContext: SparkContext)
3939 attachPage(new ThriftServerSessionPage (this ))
4040 parent.attachTab(this )
4141
42- // We need to add the filters to the handlers generated here since the SparkUI has been already
43- // started.
44- JettyUtils .addFilters(this .pages.flatMap(parent.handlersForPage), parent.conf)
45-
4642 def detach () {
4743 getSparkUI(sparkContext).detachTab(this )
4844 }
You can’t perform that action at this time.
0 commit comments