Skip to content

Commit

Permalink
Don't display "unknown app" on driver log pages
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewor14 committed Jul 23, 2014
1 parent d7e2728 commit c141a00
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import org.apache.spark.deploy.master.DriverState.DriverState

/**
* Manages the execution of one driver, including automatically restarting the driver on failure.
* This is currently only used in standalone cluster deploy mode.
*/
private[spark] class DriverRunner(
val driverId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import org.apache.spark.util.logging.FileAppender

/**
* Manages the execution of one executor process.
* This is currently only used in standalone mode.
*/
private[spark] class ExecutorRunner(
val appId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@

package org.apache.spark.deploy.worker.ui

import java.io.File
import javax.servlet.http.HttpServletRequest

import scala.xml.Node

import org.apache.spark.ui.{WebUIPage, UIUtils}
import org.apache.spark.util.Utils
import org.apache.spark.Logging
import org.apache.spark.util.logging.{FileAppender, RollingFileAppender}
import org.apache.spark.util.logging.RollingFileAppender

private[spark] class LogPage(parent: WorkerWebUI) extends WebUIPage("logPage") with Logging {
private val worker = parent.worker
Expand Down Expand Up @@ -64,11 +63,11 @@ private[spark] class LogPage(parent: WorkerWebUI) extends WebUIPage("logPage") w
val offset = Option(request.getParameter("offset")).map(_.toLong)
val byteLength = Option(request.getParameter("byteLength")).map(_.toInt).getOrElse(defaultBytes)

val (logDir, params) = (appId, executorId, driverId) match {
val (logDir, params, pageName) = (appId, executorId, driverId) match {
case (Some(a), Some(e), None) =>
(s"${workDir.getPath}/$a/$e/", s"appId=$a&executorId=$e")
(s"${workDir.getPath}/$a/$e/", s"appId=$a&executorId=$e", s"$a/$e")
case (None, None, Some(d)) =>
(s"${workDir.getPath}/$d/", s"driverId=$d")
(s"${workDir.getPath}/$d/", s"driverId=$d", d)
case _ =>
throw new Exception("Request must specify either application or driver identifiers")
}
Expand Down Expand Up @@ -120,7 +119,7 @@ private[spark] class LogPage(parent: WorkerWebUI) extends WebUIPage("logPage") w
</div>
</body>
</html>
UIUtils.basicSparkPage(content, logType + " log page for " + appId.getOrElse("unknown app"))
UIUtils.basicSparkPage(content, logType + " log page for " + pageName)
}

/** Get the part of the log files given the offset and desired length of bytes */
Expand Down

0 comments on commit c141a00

Please sign in to comment.