Skip to content

Commit 93fbe0f

Browse files
committed
Other minor fixes
1 parent cc43f68 commit 93fbe0f

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -924,9 +924,9 @@ class DAGScheduler(
924924
AccumulableInfo(id, name, Some(stringPartialValue), stringValue)
925925
}
926926
}
927-
listenerBus.post(SparkListenerTaskEnd(stageId, taskType, event.reason, event.taskInfo,
928-
event.taskMetrics))
929927
}
928+
listenerBus.post(SparkListenerTaskEnd(stageId, taskType, event.reason, event.taskInfo,
929+
event.taskMetrics))
930930
stage.pendingTasks -= task
931931
task match {
932932
case rt: ResultTask[_, _] =>

core/src/main/scala/org/apache/spark/ui/jobs/JobProgressListener.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ class JobProgressListener(conf: SparkConf) extends SparkListener with Logging {
6060
override def onStageCompleted(stageCompleted: SparkListenerStageCompleted) = synchronized {
6161
val stage = stageCompleted.stageInfo
6262
val stageId = stage.stageId
63-
6463
val stageData = stageIdToData.getOrElseUpdate(stageId, {
6564
logWarning("Stage completed for unknown stage " + stageId)
6665
new StageUIData

core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,16 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") {
215215
Some(UIUtils.listingTable(quantileHeaders, quantileRow, listings, fixedWidth = true))
216216
}
217217
val executorTable = new ExecutorTable(stageId, parent)
218+
219+
val maybeAccumulableTable: Seq[Node] =
220+
if (accumulables.size > 0) { <h4>Accumulators</h4> ++ accumulableTable } else Seq()
221+
218222
val content =
219223
summary ++
220224
<h4>Summary Metrics for {numCompleted} Completed Tasks</h4> ++
221225
<div>{summaryTable.getOrElse("No tasks have reported metrics yet.")}</div> ++
222226
<h4>Aggregated Metrics by Executor</h4> ++ executorTable.toNodeSeq ++
223-
<h4>Accumulators</h4> ++ accumulableTable ++
227+
maybeAccumulableTable ++
224228
<h4>Tasks</h4> ++ taskTable
225229

226230
UIUtils.headerSparkPage(content, basePath, appName, "Details for Stage %d".format(stageId),

docs/programming-guide.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,8 +1174,9 @@ value of the broadcast variable (e.g. if the variable is shipped to a new node l
11741174
Accumulators are variables that are only "added" to through an associative operation and can
11751175
therefore be efficiently supported in parallel. They can be used to implement counters (as in
11761176
MapReduce) or sums. Spark natively supports accumulators of numeric types, and programmers
1177-
can add support for new types. Accumulator values are displayed in Spark's UI and can be
1178-
useful for understanding the progress of running stages.
1177+
can add support for new types. If accumulators are created with a name, they will be
1178+
displayed in Spark's UI. This can can be useful for understanding the progress of
1179+
running stages (NOTE: this is not yet supported in Python).
11791180

11801181
An accumulator is created from an initial value `v` by calling `SparkContext.accumulator(v)`. Tasks
11811182
running on the cluster can then add to it using the `add` method or the `+=` operator (in Scala and Python).

0 commit comments

Comments
 (0)