Github user ksakellis commented on a diff in the pull request:
https://github.com/apache/spark/pull/4020#discussion_r23056809
--- Diff: core/src/main/scala/org/apache/spark/executor/TaskMetrics.scala
---
@@ -240,10 +284,18 @@ class ShuffleWriteMetrics extends Serializable {
/**
* Number of bytes written for the shuffle by this task
*/
- @volatile var shuffleBytesWritten: Long = _
-
+ @volatile private var _shuffleBytesWritten: Long = _
+ def shuffleBytesWritten = _shuffleBytesWritten
+ private[spark] def incShuffleBytesWritten(value: Long) =
_shuffleBytesWritten += value
+ private[spark] def decShuffleBytesWritten(value: Long) =
_shuffleBytesWritten -= value
+
/**
* Time the task spent blocking on writes to disk or buffer cache, in
nanoseconds
*/
- @volatile var shuffleWriteTime: Long = _
--- End diff --
Can we make these AtomicLong's so that the incrementing can be threadsafe.
I have a pr out that does this:
https://github.com/apache/spark/pull/3120/files#diff-1bd3dc38f6306e0a822f93d62c32b1d0R226
for input metrics. I'd be good to do this throughout.
---
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]