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

    https://github.com/apache/spark/pull/7770#discussion_r36054177
  
    --- Diff: core/src/main/scala/org/apache/spark/Aggregator.scala ---
    @@ -89,13 +84,18 @@ case class Aggregator[K, V, C] (
         } else {
           val combiners = new ExternalAppendOnlyMap[K, C, C](identity, 
mergeCombiners, mergeCombiners)
           combiners.insertAll(iter)
    -      // Update task metrics if context is not null
    -      // TODO: Make context non-optional in a future release
    -      Option(context).foreach { c =>
    -        c.taskMetrics.incMemoryBytesSpilled(combiners.memoryBytesSpilled)
    -        c.taskMetrics.incDiskBytesSpilled(combiners.diskBytesSpilled)
    -      }
    +      updateMetrics(context, combiners)
           combiners.iterator
         }
       }
    +
    +  /** Update task metrics after populating the external map. */
    +  private def updateMetrics(context: TaskContext, map: 
ExternalAppendOnlyMap[_, _, _]): Unit = {
    +    Option(context).foreach { c =>
    --- End diff --
    
    should we leave the TODO here, or is it not worth bothering with?


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to