Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mgaido91 committed Jun 12, 2018
1 parent 08cd576 commit 02a9f4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 4 additions & 2 deletions core/src/main/scala/org/apache/spark/ui/JettyUtils.scala
Expand Up @@ -407,7 +407,7 @@ private[spark] object JettyUtils extends Logging {
}

pool.setMaxThreads(math.max(pool.getMaxThreads, minThreads))
ServerInfo(server, httpPort, securePort, collection)
ServerInfo(server, httpPort, securePort, conf, collection)
} catch {
case e: Exception =>
server.stop()
Expand Down Expand Up @@ -507,10 +507,12 @@ private[spark] case class ServerInfo(
server: Server,
boundPort: Int,
securePort: Option[Int],
conf: SparkConf,
private val rootHandler: ContextHandlerCollection) {

def addHandler(handler: ContextHandler): Unit = {
def addHandler(handler: ServletContextHandler): Unit = {
handler.setVirtualHosts(JettyUtils.toVirtualHosts(JettyUtils.SPARK_CONNECTOR_NAME))
JettyUtils.addFilters(Seq(handler), conf)
rootHandler.addHandler(handler)
if (!handler.isStarted()) {
handler.start()
Expand Down
7 changes: 1 addition & 6 deletions core/src/main/scala/org/apache/spark/ui/WebUI.scala
Expand Up @@ -91,12 +91,7 @@ private[spark] abstract class WebUI(
/** Attach a handler to this UI. */
def attachHandler(handler: ServletContextHandler) {
handlers += handler
serverInfo.foreach { sInfo =>
sInfo.addHandler(handler)
// If the UI has already been bound, we need to add the filters to the newly attached
// handlers. Otherwise, they will be attached when binding.
addFilters(Seq(handler), conf)
}
serverInfo.foreach(_.addHandler(handler))
}

/** Detach a handler from this UI. */
Expand Down

0 comments on commit 02a9f4e

Please sign in to comment.