Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/7590#discussion_r35240781
--- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
@@ -1233,8 +1233,8 @@ class SparkContext(config: SparkConf) extends Logging
with ExecutorAllocationCli
* in the Spark UI. Tasks can "add" values to the accumulator using the
`+=` method. Only the
* driver can access the accumulator's `value`.
*/
- def accumulator[T](initialValue: T, name: String)(implicit param:
AccumulatorParam[T])
- : Accumulator[T] = {
+ def accumulator[T](initialValue: T, name: String, internal: Boolean =
false)(
--- End diff --
In order to preserve binary compatibility, you need to add an overload
which does not accept the `internal` flag.
```
[error] * method
accumulator(java.lang.Object,java.lang.String,org.apache.spark.AccumulatorParam)org.apache.spark.Accumulator
in class org.apache.spark.SparkContext does not have a correspondent in new
version
[error] filter with:
ProblemFilters.exclude[MissingMethodProblem]("org.apache.spark.SparkContext.accumulator")
```
In order to avoid ambiguity, Scala does not allow you to overload a method
if any of the overloads define default arguments. As a result, I think that we
might want to avoid making any user-facing changes to the SparkContext and
create a `private[spark] internalAccumulator()` method instead.
---
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]