Skip to content

Commit

Permalink
Remove Executor events from webui timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
markhamstra committed Apr 15, 2015
1 parent bbeb16c commit 55c0be6
Showing 1 changed file with 1 addition and 39 deletions.
40 changes: 1 addition & 39 deletions core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,39 +73,6 @@ private[ui] class AllJobsPage(parent: JobsTab) extends WebUIPage("") {
Option(jobEventJsonAsStr)
}

val executorEventJsonAsStrSeq =
(listener.executorIdToAddedTime ++
listener.executorIdToRemovedTimeAndReason).map { event =>
val (executorId: String, status: String, time: Long, reason: Option[String]) =
event match {
case (executorId, (removedTime, reason)) =>
(executorId, "removed", removedTime, Some(reason))
case (executorId, addedTime) =>
(executorId, "added", addedTime, None)
}
s"""
|{
| 'className': 'executor ${status}',
| 'group': 'executors',
| 'start': new Date(${time}),
| 'content': '<div>Executor ${executorId} ${status}</div>',
| 'title': '${if (status == "added") "Added" else "Removed"} ' +
| 'at ${UIUtils.formatDate(new Date(time))}' +
| '${if (reason.isDefined) s"""\\nReason: ${reason.get}""" else ""}'
|}
""".stripMargin
}

val executorsLegend =
<div class="legend-area"><svg width="200px" height="55px">
<rect x="5px" y="5px" width="20px" height="15px"
rx="2px" ry="2px" stroke="#97B0F8" fill="#D5DDF6"></rect>
<text x="35px" y="17px">Executor Added</text>
<rect x="5px" y="35px" width="20px" height="15px"
rx="2px" ry="2px" stroke="#97B0F8" fill="#EBCA59"></rect>
<text x="35px" y="47px">Executor Removed</text>
</svg></div>.toString.filter(_ != '\n')

val jobsLegend =
<div class="legend-area"><svg width="200px" height="85px">
<rect x="5px" y="5px" width="20px" height="15px"
Expand All @@ -123,18 +90,13 @@ private[ui] class AllJobsPage(parent: JobsTab) extends WebUIPage("") {
s"""
|[
| {
| 'id': 'executors',
| 'content': '<div>Executors</div>${executorsLegend}',
| },
| {
| 'id': 'jobs',
| 'content': '<div>Jobs</div>${jobsLegend}',
| }
|]
""".stripMargin

val eventArrayAsStr =
(jobEventJsonAsStrSeq ++ executorEventJsonAsStrSeq).mkString("[", ",", "]")
jobEventJsonAsStrSeq.mkString("[", ",", "]")

<div class="control-panel">
<div id="application-timeline-zoom-lock">
Expand Down

0 comments on commit 55c0be6

Please sign in to comment.