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(
152
152
assert(serverInfo.isDefined, " HistoryServer must be bound before attaching SparkUIs" )
153
153
handlers.synchronized {
154
154
ui.getHandlers.foreach(attachHandler)
155
- addFilters(ui.getHandlers, conf)
156
155
}
157
156
}
158
157
Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ private[spark] object JettyUtils extends Logging {
263
263
filters.foreach {
264
264
case filter : String =>
265
265
if (! filter.isEmpty) {
266
- logInfo(" Adding filter: " + filter )
266
+ logInfo(s " Adding filter $filter to ${handlers.map(_.getContextPath).mkString( " , " )} . " )
267
267
val holder : FilterHolder = new FilterHolder ()
268
268
holder.setClassName(filter)
269
269
// 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(
93
93
/** Attach a handler to this UI. */
94
94
def attachHandler (handler : ServletContextHandler ) {
95
95
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
+ }
97
102
}
98
103
99
104
/** 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)
39
39
attachPage(new ThriftServerSessionPage (this ))
40
40
parent.attachTab(this )
41
41
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
-
46
42
def detach () {
47
43
getSparkUI(sparkContext).detachTab(this )
48
44
}
You can’t perform that action at this time.
0 commit comments