Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/10835#discussion_r50743090
--- Diff: core/src/main/scala/org/apache/spark/Accumulable.scala ---
@@ -139,22 +148,28 @@ class Accumulable[R, T] private[spark] (
}
/**
- * Set the accumulator's value; only allowed on master
+ * Set the accumulator's value. For internal use only.
*/
- def setValue(newValue: R) {
- this.value = newValue
- }
+ def setValue(newValue: R): Unit = { value_ = newValue }
+
+ /**
+ * Set the accumulator's value. For internal use only.
+ */
+ private[spark] def setValueAny(newValue: Any): Unit = {
setValue(newValue.asInstanceOf[R]) }
// Called by Java when deserializing an object
private def readObject(in: ObjectInputStream): Unit =
Utils.tryOrIOException {
in.defaultReadObject()
- value_ = zero
- deserialized = true
+ // TODO: As of SPARK-12895 we send accumulators both ways between
executors and the driver.
+ // If we set the value to zero here we would zero out all accumulator
updates on the driver,
+ // which is not what we want. Let's comment this out for now until
SPARK-12896, which allows
+ // us to avoid sending accumulators from the executors to the driver.
--- End diff --
TaskMetrics are accumulators. If we send TaskMetrics then we send
accumulators.
---
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]