Package org.apache.spark.util
Class SparkClosureCleaner
Object
org.apache.spark.util.SparkClosureCleaner
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <F> Fclean(F closure, boolean checkSerializable, boolean cleanTransitively) Clean the given closure in place.
-
Constructor Details
-
SparkClosureCleaner
public SparkClosureCleaner()
-
-
Method Details
-
clean
public static <F> F clean(F closure, boolean checkSerializable, boolean cleanTransitively) Clean the given closure in place.More specifically, this renders the given closure serializable as long as it does not explicitly reference unserializable objects.
- Parameters:
closure- the closure to cleancheckSerializable- whether to verify that the closure is serializable after cleaningcleanTransitively- whether to clean enclosing closures transitively- Returns:
- Cleaned closure if it was actually cleaned or the original closure otherwise
-