Github user pwendell commented on a diff in the pull request:
https://github.com/apache/spark/pull/42#discussion_r10730434
--- Diff:
core/src/main/scala/org/apache/spark/deploy/master/ui/MasterWebUI.scala ---
@@ -57,27 +67,38 @@ class MasterWebUI(val master: Master, requestedPort:
Int) extends Logging {
}
}
- val metricsHandlers = master.masterMetricsSystem.getServletHandlers ++
- master.applicationMetricsSystem.getServletHandlers
+ def boundPort: Int = serverInfo.map(_.boundPort).getOrElse(-1)
- 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) {
+ assert(serverInfo.isDefined, "Master UI must be initialized before
attaching SparkUIs")
--- End diff --
Tiny nit - but it's not totally clear what initialize means here. It might
make sense to say `initialized with bind()` or to add a javadoc in `bind()`
that uses the word initialize.
---
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.
---