Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/3570#discussion_r21573219
--- Diff: core/src/main/scala/org/apache/spark/Accumulators.scala ---
@@ -281,7 +282,9 @@ object AccumulatorParam {
private object Accumulators {
// TODO: Use soft references? => need to make readObject work properly
then
val originals = Map[Long, Accumulable[_, _]]()
- val localAccums = Map[Thread, Map[Long, Accumulable[_, _]]]()
+ val localAccums = new ThreadLocal[Map[Long, Accumulable[_, _]]]() {
+ override protected def initialValue() = Map[Long, Accumulable[_, _]]()
+ }
var lastId: Long = 0
--- End diff --
Oh, I was just observing that this is only read through the `newIdI()`
method and that it's effectively being used like an AtomicInteger. Just
another example of how this particular part of the code is kind of old /
out-of-sync with the style of the rest of the codebase. Don't worry about it;
we can do a larger cleanup pass on this later.
---
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]