Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/12936#discussion_r62594264
--- Diff: core/src/main/scala/org/apache/spark/util/AccumulatorV2.scala ---
@@ -137,10 +148,10 @@ abstract class AccumulatorV2[IN, OUT] extends
Serializable {
throw new UnsupportedOperationException(
"Accumulator must be registered before send to executor")
}
- val copy = copyAndReset()
- assert(copy.isZero, "copyAndReset must return a zero value copy")
- copy.metadata = metadata
- copy
+ val copyAcc = copy().reset()
--- End diff --
we should use `copyAndReset()` here, which maybe more efficient
---
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]