Skip to content

Commit 0ac1848

Browse files
committed
address comments
1 parent 086a4f6 commit 0ac1848

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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

core/src/main/scala/org/apache/spark/ui/JettyUtils.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

core/src/main/scala/org/apache/spark/ui/WebUI.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff 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. */

sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerTab.scala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)