Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.1.0
Description
This is particularly bad because we expose this as a developer API. Technically a library could create a TaskMetrics object and then change the values inside of it and pass it onto someone else. It can be written pretty compactly like below:
/** * Number of bytes written for the shuffle by this task */ @volatile private var _shuffleBytesWritten: Long = _ def incrementShuffleBytesWritten(value: Long) = _shuffleBytesWritten += value def decrementShuffleBytesWritten(value: Long) = _shuffleBytesWritten -= value def shuffleBytesWritten = _shuffleBytesWritten