@@ -60,22 +60,24 @@ private[spark] abstract class WebUI(
6060 def getHandlers : Seq [ServletContextHandler ] = handlers
6161 def getSecurityManager : SecurityManager = securityManager
6262
63- /** Attach a tab to this UI, along with all of its attached pages. */
63+ /** Attaches a tab to this UI, along with all of its attached pages. */
6464 def attachTab (tab : WebUITab ) {
6565 tab.pages.foreach(attachPage)
6666 tabs += tab
6767 }
6868
69+ /** Detaches a tab from this UI. */
6970 def detachTab (tab : WebUITab ) {
7071 tab.pages.foreach(detachPage)
7172 tabs -= tab
7273 }
7374
75+ /** Detaches a page from this UI. */
7476 def detachPage (page : WebUIPage ) {
7577 pageToHandlers.remove(page).foreach(_.foreach(detachHandler))
7678 }
7779
78- /** Attach a page to this UI. */
80+ /** Attaches a page to this UI. */
7981 def attachPage (page : WebUIPage ) {
8082 val pagePath = " /" + page.prefix
8183 val renderHandler = createServletHandler(pagePath,
@@ -88,13 +90,13 @@ private[spark] abstract class WebUI(
8890 handlers += renderHandler
8991 }
9092
91- /** Attach a handler to this UI. */
93+ /** Attaches a handler to this UI. */
9294 def attachHandler (handler : ServletContextHandler ) {
9395 handlers += handler
9496 serverInfo.foreach(_.addHandler(handler))
9597 }
9698
97- /** Detach a handler from this UI. */
99+ /** Detaches a handler from this UI. */
98100 def detachHandler (handler : ServletContextHandler ) {
99101 handlers -= handler
100102 serverInfo.foreach(_.removeHandler(handler))
@@ -111,18 +113,18 @@ private[spark] abstract class WebUI(
111113 }
112114
113115 /**
114- * Remove a static content handler.
116+ * Removes a static content handler.
115117 *
116118 * @param path Path in UI to unmount.
117119 */
118120 def removeStaticHandler (path : String ): Unit = {
119121 handlers.find(_.getContextPath() == path).foreach(detachHandler)
120122 }
121123
122- /** Initialize all components of the server. */
124+ /** Initializes all components of the server. */
123125 def initialize (): Unit
124126
125- /** Bind to the HTTP server behind this web interface. */
127+ /** Binds to the HTTP server behind this web interface. */
126128 def bind (): Unit = {
127129 assert(serverInfo.isEmpty, s " Attempted to bind $className more than once! " )
128130 try {
@@ -136,13 +138,13 @@ private[spark] abstract class WebUI(
136138 }
137139 }
138140
139- /** Return the url of web interface. Only valid after bind() . */
141+ /** @return The url of web interface. Only valid after [[ bind ]] . */
140142 def webUrl : String = s " http:// $publicHostName: $boundPort"
141143
142- /** Return the actual port to which this server is bound. Only valid after bind(). */
144+ /** @return The actual port to which this server is bound. Only valid after bind(). */
143145 def boundPort : Int = serverInfo.map(_.boundPort).getOrElse(- 1 )
144146
145- /** Stop the server behind this web interface. Only valid after bind() . */
147+ /** Stops the server behind this web interface. Only valid after [[ bind ]] . */
146148 def stop (): Unit = {
147149 assert(serverInfo.isDefined,
148150 s " Attempted to stop $className before binding to a server! " )
0 commit comments