Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/12936#discussion_r62553315
--- Diff: core/src/main/scala/org/apache/spark/executor/TaskMetrics.scala
---
@@ -291,11 +291,20 @@ private[spark] object TaskMetrics extends Logging {
private[spark] class BlockStatusesAccumulator
extends AccumulatorV2[(BlockId, BlockStatus), Seq[(BlockId,
BlockStatus)]] {
- private[this] var _seq = ArrayBuffer.empty[(BlockId, BlockStatus)]
+ private var _seq = ArrayBuffer.empty[(BlockId, BlockStatus)]
override def isZero(): Boolean = _seq.isEmpty
- override def copyAndReset(): BlockStatusesAccumulator = new
BlockStatusesAccumulator
+ override def copy(): BlockStatusesAccumulator = {
--- End diff --
We can just have a copyAndReset with default implementation to call copy
and then reset. Specific accumulator implementations (like this one) can
override that to optimize. Otherwise users have to implement too many functions.
---
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]