Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/11105#discussion_r86483290
--- Diff: core/src/main/scala/org/apache/spark/util/AccumulatorV2.scala ---
@@ -306,18 +428,19 @@ class LongAccumulator extends AccumulatorV2[jl.Long,
jl.Long] {
/**
* Adds v to the accumulator, i.e. increment sum by v and count by 1.
- * @since 2.0.0
+ * Added for simplicity with adding non java Longs.
+ * @since 2.1.0
*/
- override def add(v: jl.Long): Unit = {
- _sum += v
- _count += 1
+ def add(v: Long): Unit = {
--- End diff --
yeah I don't love the copied code either. The thing is, `@specialized` has
bigger ramfications -- the actual classes that get used (eg. that you see in
stack traces) are different, tricker to access the right class from java,
there are a ton of generated classes when there is multiple inheritance (not
relevant here at the moment, but perhaps in the future). I think having copied
code is the lesser of two evils.
---
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]