aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/scala/spark/deploy/master/ui/MasterWebUI.scala
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/scala/spark/deploy/master/ui/MasterWebUI.scala')
-rw-r--r--core/src/main/scala/spark/deploy/master/ui/MasterWebUI.scala59
1 files changed, 0 insertions, 59 deletions
diff --git a/core/src/main/scala/spark/deploy/master/ui/MasterWebUI.scala b/core/src/main/scala/spark/deploy/master/ui/MasterWebUI.scala
deleted file mode 100644
index bcc4d49234..0000000000
--- a/core/src/main/scala/spark/deploy/master/ui/MasterWebUI.scala
+++ /dev/null
@@ -1,59 +0,0 @@
-package spark.deploy.master.ui
-
-import akka.actor.ActorRef
-import scala.concurrent.duration._
-
-import javax.servlet.http.HttpServletRequest
-
-import org.eclipse.jetty.server.{Handler, Server}
-
-import spark.{Logging, Utils}
-import spark.ui.JettyUtils
-import spark.ui.JettyUtils._
-
-/**
- * Web UI server for the standalone master.
- */
-private[spark]
-class MasterWebUI(val master: ActorRef, requestedPort: Option[Int] = None) extends Logging {
- implicit val timeout = Duration.create(
- System.getProperty("spark.akka.askTimeout", "10").toLong, "seconds")
- val host = Utils.localHostName()
- val port = requestedPort.getOrElse(
- System.getProperty("master.ui.port", MasterWebUI.DEFAULT_PORT).toInt)
-
- var server: Option[Server] = None
- var boundPort: Option[Int] = None
-
- val applicationPage = new ApplicationPage(this)
- val indexPage = new IndexPage(this)
-
- def start() {
- try {
- val (srv, bPort) = JettyUtils.startJettyServer("0.0.0.0", port, handlers)
- server = Some(srv)
- boundPort = Some(bPort)
- logInfo("Started Master web UI at http://%s:%d".format(host, boundPort.get))
- } catch {
- case e: Exception =>
- logError("Failed to create Master JettyUtils", e)
- System.exit(1)
- }
- }
-
- val handlers = Array[(String, Handler)](
- ("/static", createStaticHandler(MasterWebUI.STATIC_RESOURCE_DIR)),
- ("/app/json", (request: HttpServletRequest) => applicationPage.renderJson(request)),
- ("/app", (request: HttpServletRequest) => applicationPage.render(request)),
- ("*", (request: HttpServletRequest) => indexPage.render(request))
- )
-
- def stop() {
- server.foreach(_.stop())
- }
-}
-
-private[spark] object MasterWebUI {
- val STATIC_RESOURCE_DIR = "spark/ui/static"
- val DEFAULT_PORT = "8080"
-}