You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by pwendell <gi...@git.apache.org> on 2014/08/02 00:53:51 UTC

[GitHub] spark pull request: SPARK-2380: Support displaying accumulator val...

Github user pwendell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1309#discussion_r15723155
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala ---
    @@ -809,12 +810,25 @@ class DAGScheduler(
           listenerBus.post(SparkListenerStageCompleted(stageToInfos(stage)))
           runningStages -= stage
         }
    +
         event.reason match {
           case Success =>
             logInfo("Completed " + task)
             if (event.accumUpdates != null) {
               // TODO: fail the stage if the accumulator update fails...
               Accumulators.add(event.accumUpdates) // TODO: do this only if task wasn't resubmitted
    +          event.accumUpdates.foreach { case (id, partialValue) =>
    +            val acc = Accumulators.originals(id).asInstanceOf[Accumulable[Any, Any]]
    +            val name = acc.name
    +            // To avoid UI cruft, ignore cases where value wasn't updated
    +            if (partialValue != acc.zero) {
    +              val stringPartialValue = acc.prettyPartialValue(partialValue)
    +              val stringValue = acc.prettyValue(acc.value)
    +              stageToInfos(stage).accumulables(id) = AccumulableInfo(id, acc.name, stringValue)
    +              event.taskInfo.accumulables +=
    +                AccumulableInfo(id, name, Some(stringPartialValue), stringValue)
    +            }
    +          }
    --- End diff --
    
    @AmplabJenkins yeah we can move these elsewhere, good idead.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---