Github user pwendell commented on a diff in the pull request:
https://github.com/apache/spark/pull/42#discussion_r10642128
--- Diff:
core/src/main/scala/org/apache/spark/deploy/master/ui/MasterWebUI.scala ---
@@ -57,21 +74,20 @@ class MasterWebUI(val master: Master, requestedPort:
Int) extends Logging {
}
}
- val metricsHandlers = master.masterMetricsSystem.getServletHandlers ++
- master.applicationMetricsSystem.getServletHandlers
-
- val handlers = metricsHandlers ++ Seq[ServletContextHandler](
- createStaticHandler(MasterWebUI.STATIC_RESOURCE_DIR, "/static/*"),
- createServletHandler("/app/json",
- createServlet((request: HttpServletRequest) =>
applicationPage.renderJson(request),
- master.securityMgr)),
- createServletHandler("/app", createServlet((request:
HttpServletRequest) => applicationPage
- .render(request), master.securityMgr)),
- createServletHandler("/json", createServlet((request:
HttpServletRequest) => indexPage
- .renderJson(request), master.securityMgr)),
- createServletHandler("*", createServlet((request: HttpServletRequest)
=> indexPage.render
- (request), master.securityMgr))
- )
+ /** Attach a reconstructed UI to this Master UI. Only valid after
bind(). */
+ def attachUI(ui: SparkUI) {
+ rootHandler.foreach { root =>
--- End diff --
Unless there is a normal case where this can be called with
`rootHandler=None` I'd make this an assertion at the beginning and use
`rootHandler.get`:
```
assert(serverInfo.isDefined, "Tried to attach SparkUI to master that wasn't
initialized")
```
or something...
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---