Github user andrewor14 commented on the pull request:
https://github.com/apache/spark/pull/10841#issuecomment-177045002
@holdenk Thanks for spending the time to put forth the detailed design. I
agree 100% with the problem and have thought a great deal about how to fix it
myself. However, I personally found the proposed API kind of clunky. It's not
super clear what "consistent" means, especially to someone new to Spark. I
think it would be cleaner to just implement this in the existing classes
themselves and maybe expose only a flag.
It seems that on a high level we want to associate an accumulated value
with a particular computation of an RDD. Can we store something like a map from
RDD ID to a list of accumulated values in each accumulator? Then if the user
calls `acc.value` we just sum all of them up. If the user wants an accumulated
value associated with a particular RDD or even a particular computation then
they can also do that. E.g.
```
class AccumulableInfo[R, T](...) {
private val valuesByRDD = mutable.HashMap[Int, ArrayBuffer[R]]
def value: R = valuesByRDD.values.reduce(mergeThemAll)
def valueByRDD(rddId: Int): R = valuesByRDD(rddId).reduce(mergeThemAll)
}
```
Even this may solve only part of the problem, where the same accumulator
used across different RDDs, but maybe it's a better first step. I may be
missing something but I don't see the need to introduce all these new classes;
the existing set is confusing enough and in the past we've made the mistake of
exposing all of them to the user.
Also, I believe @rxin has some thoughts on this.
---
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]