Github user mbalassi commented on a diff in the pull request: https://github.com/apache/flink/pull/813#discussion_r32102485 --- Diff: flink-staging/flink-streaming/flink-streaming-scala/src/main/scala/org/apache/flink/streaming/api/scala/StreamExecutionEnvironment.scala --- @@ -455,15 +455,22 @@ class StreamExecutionEnvironment(javaEnv: JavaEnv) { */ def getStreamGraph = javaEnv.getStreamGraph + /** + * Returns a "closure-cleaned" version of the given function. Cleans only if closure cleaning + * is not disabled in the {@link org.apache.flink.api.common.ExecutionConfig} + */ + private[flink] def clean[F <: AnyRef](f: F): F = { + if (getConfig.isClosureCleanerEnabled) { + ClosureCleaner.clean(f, true) + } else { + ClosureCleaner.ensureSerializable(f) + } + f + } --- End diff -- I would suggest to have just this clean.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---