[ https://issues.apache.org/jira/browse/FLINK-2191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14580331#comment-14580331 ]
ASF GitHub Bot commented on FLINK-2191: --------------------------------------- Github user aljoscha commented on a diff in the pull request: https://github.com/apache/flink/pull/813#discussion_r32103307 --- 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 will look into it. The problem is that the DataStream and all the other classes don't have a reference to the Scala StreamExecutionEnvironment. > Inconsistent use of Closure Cleaner in Streaming API > ---------------------------------------------------- > > Key: FLINK-2191 > URL: https://issues.apache.org/jira/browse/FLINK-2191 > Project: Flink > Issue Type: Bug > Components: Streaming > Affects Versions: 0.9 > Reporter: Aljoscha Krettek > Assignee: Aljoscha Krettek > Priority: Blocker > > In the streaming API operations on DataStream.java call clean() if the > closure cleaner is enabled in the execution config. Methods in > StreamExecutionEnvironment.java always call clean, no way of disabling it. > Operations in the Scala Streaming API also always call clean(), no way of > disabling it. -- This message was sent by Atlassian JIRA (v6.3.4#6332)