Skip to content

Commit ced09ce

Browse files
author
Marcelo Vanzin
committed
Minor cleanup.
1 parent a429135 commit ced09ce

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,10 @@ private[spark] object JettyUtils extends Logging {
337337
val securePort = sslOptions.createJettySslContextFactory().map { factory =>
338338
val securePort = sslOptions.port.getOrElse(if (port > 0) Utils.userPort(port, 400) else 0)
339339
val secureServerName = if (serverName.nonEmpty) s"$serverName (HTTPS)" else serverName
340+
val connectionFactories = AbstractConnectionFactory.getFactories(factory,
341+
new HttpConnectionFactory())
340342

341343
def sslConnect(currentPort: Int): (ServerConnector, Int) = {
342-
val connectionFactories = AbstractConnectionFactory.getFactories(factory,
343-
new HttpConnectionFactory())
344344
newConnector(connectionFactories, currentPort)
345345
}
346346

@@ -365,14 +365,15 @@ private[spark] object JettyUtils extends Logging {
365365
redirector.start()
366366
}
367367

368-
// Add all the known handlers and install the connectors.
368+
server.addConnector(httpConnector)
369+
370+
// Add all the known handlers now that connectors are configured.
369371
handlers.foreach { h =>
370372
val gzipHandler = new GzipHandler()
371373
gzipHandler.setHandler(h)
372374
collection.addHandler(gzipHandler)
373375
gzipHandler.start()
374376
}
375-
server.addConnector(httpConnector)
376377

377378
pool.setMaxThreads(math.max(pool.getMaxThreads, minThreads))
378379
ServerInfo(server, httpPort, securePort, collection)

0 commit comments

Comments
 (0)