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

    https://github.com/apache/spark/pull/189#discussion_r11314584
  
    --- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
    @@ -1031,9 +1033,16 @@ class SparkContext(
        * Clean a closure to make it ready to serialized and send to tasks
        * (removes unreferenced variables in $outer's, updates REPL variables)
        */
    -  private[spark] def clean[F <: AnyRef](f: F): F = {
    -    ClosureCleaner.clean(f)
    -    f
    +  private[spark] def clean[F <: AnyRef : ClassTag](f: F): F = {
    +    clean(f, true)
    +  }
    +
    +  /**
    +   * Clean a closure to make it ready to serialized and send to tasks
    +   * (removes unreferenced variables in $outer's, updates REPL variables)
    +   */
    +  private[spark] def clean[F <: AnyRef : ClassTag](f: F, 
checkSerializable: Boolean): F = {
    +    ClosureCleaner.clean(f, checkSerializable)
       }
    --- End diff --
    
    Instead of adding two methods, just add a default argument to the first one 
(`captureNow: Boolean = true`).


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

Reply via email to