Skip to content

Commit abe816b

Browse files
committed
Make proactive serializability checking optional.
SparkContext.clean uses ClosureCleaner's proactive serializability checking by default. This commit adds a parameter to the clean method of SparkContext that allows clients to specify that serializability checking should not occur as part of closure cleaning.
1 parent 5bfff24 commit abe816b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/main/scala/org/apache/spark/SparkContext.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,8 +1205,8 @@ class SparkContext(config: SparkConf) extends Logging {
12051205
* Clean a closure to make it ready to serialized and send to tasks
12061206
* (removes unreferenced variables in $outer's, updates REPL variables)
12071207
*/
1208-
private[spark] def clean[F <: AnyRef](f: F): F = {
1209-
ClosureCleaner.clean(f)
1208+
private[spark] def clean[F <: AnyRef](f: F, checkSerializable: Boolean = true): F = {
1209+
ClosureCleaner.clean(f, checkSerializable)
12101210
f
12111211
}
12121212

0 commit comments

Comments
 (0)