Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/2782#issuecomment-58914348
  
    Is there any easy way to reduce the visibility of `markTaskCompleted()` and 
the other internal methods?  Could we maybe move those to `TaskContextImpl` and 
leave `TaskContext` as an abstract base class with no actual methods actually 
implemented (if I recall, we can't convert it to an interface for binary 
compatibility reasons)?
    
    If we do that, you could use some tricks to cut down on the amount of 
boilerplate getter code code in TaskContext.  In #2696, for example, I use this 
pattern:
    
    Java interface / abstract base class:
    
    ```scala
    public interface SparkJobInfo {
      int jobId();
      int[] stageIds();
      String status();
    }
    ```
    
    Scala implementation:
    
    ```scala
    private class SparkJobInfoImpl (
      val jobId: Int,
      val stageIds: Array[Int],
      val status: String)
     extends SparkJobInfo
    ```


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