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

    https://github.com/apache/spark/pull/15371#discussion_r82509108
  
    --- Diff: core/src/main/scala/org/apache/spark/executor/TaskMetrics.scala 
---
    @@ -326,36 +324,13 @@ private[spark] object TaskMetrics extends Logging {
     
     
     private[spark] class BlockStatusesAccumulator
    -  extends AccumulatorV2[(BlockId, BlockStatus), java.util.List[(BlockId, 
BlockStatus)]] {
    -  private val _seq = Collections.synchronizedList(new ArrayList[(BlockId, 
BlockStatus)]())
    -
    -  override def isZero(): Boolean = _seq.isEmpty
    +  extends CollectionAccumulator[(BlockId, BlockStatus)] {
     
       override def copyAndReset(): BlockStatusesAccumulator = new 
BlockStatusesAccumulator
     
       override def copy(): BlockStatusesAccumulator = {
         val newAcc = new BlockStatusesAccumulator
    -    newAcc._seq.addAll(_seq)
    +    newAcc._list.addAll(_list)
    --- End diff --
    
    Good point. I will do the proposed change. I am also going to change the 
base class (`CollectionAccumulator`) because behavior of `addAll` is undefined 
if the specified collection is modified and `merge()` is working on immutable 
copy when calling `addAll`. 
    



---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to