Github user pwendell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1507#discussion_r15907133
  
    --- Diff: core/src/main/scala/org/apache/spark/executor/TaskMetrics.scala 
---
    @@ -73,11 +75,16 @@ class TaskMetrics extends Serializable {
       var inputMetrics: Option[InputMetrics] = None
     
       /**
    -   * If this task reads from shuffle output, metrics on getting shuffle 
data will be collected here
    +   * If this task reads from shuffle output, metrics on getting shuffle 
data will be collected here.
    +   * This includes read metrics aggregated over all the task's shuffle 
dependencies.
        */
    -  private var _shuffleReadMetrics: Option[ShuffleReadMetrics] = None
    +  var shuffleReadMetrics: Option[ShuffleReadMetrics] = None
    --- End diff --
    
    by "users" I mean internal spark code that instruments this. I think it is 
counter intuitive to make something a var (and to expose it as a var publicly) 
but actually there is no intended use where someone modifies this var. There is 
a corner case here where we deserialize an object form JSON - so I'd propose we 
create a very narrow interface to deal with that case - a setter with clear 
documentation. I really think object deserialization is a special case here... 
if something is mutable for the purpose of deserializing - IMO - that's quite 
different than making it mutable outright for normal program execution.


---
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]

Reply via email to