spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Apache Spark (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SPARK-3288) All fields in TaskMetrics should be private and use getters/setters
Date Tue, 13 Jan 2015 17:50:34 GMT

    [ https://issues.apache.org/jira/browse/SPARK-3288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14275600#comment-14275600
] 

Apache Spark commented on SPARK-3288:
-------------------------------------

User 'ilganeli' has created a pull request for this issue:
https://github.com/apache/spark/pull/4020

> All fields in TaskMetrics should be private and use getters/setters
> -------------------------------------------------------------------
>
>                 Key: SPARK-3288
>                 URL: https://issues.apache.org/jira/browse/SPARK-3288
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core
>    Affects Versions: 1.1.0
>            Reporter: Patrick Wendell
>            Assignee: Dale Richardson
>              Labels: starter
>
> 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:
> {code}
>   /**
>    * 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
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message