Github user feynmanliang commented on a diff in the pull request:
https://github.com/apache/spark/pull/7590#discussion_r35272320
--- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
@@ -1234,13 +1234,26 @@ class SparkContext(config: SparkConf) extends
Logging with ExecutorAllocationCli
* driver can access the accumulator's `value`.
*/
def accumulator[T](initialValue: T, name: String)(implicit param:
AccumulatorParam[T])
- : Accumulator[T] = {
+ : Accumulator[T] = {
val acc = new Accumulator(initialValue, param, Some(name))
cleaner.foreach(_.registerAccumulatorForCleanup(acc))
acc
}
/**
+ * Create an [[org.apache.spark.Accumulator]] variable of a given type,
with a name for display
--- End diff --
OK. Will also document that `T` needs to be thread-safe since #7448
---
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]