[ https://issues.apache.org/jira/browse/FLINK-3335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15132453#comment-15132453 ]
Gabor Gevay commented on FLINK-3335: ------------------------------------ Are you sure that adding that copy is the best solution here? An alternative solution would be to specify in the javadoc of InputFormat.nextRecord that it should satisfy the same contract that also governs how UDFs like MapFunction treat objects that they return or give to Collector.collect. (See here: https://docs.google.com/document/d/1cgkuttvmj4jUonG7E2RdFVjKlfQDm_hE6gvFcgAfzXg/edit) > DataSourceTask object reuse when disabled > ----------------------------------------- > > Key: FLINK-3335 > URL: https://issues.apache.org/jira/browse/FLINK-3335 > Project: Flink > Issue Type: Bug > Components: Distributed Runtime > Affects Versions: 1.0.0 > Reporter: Greg Hogan > Assignee: Greg Hogan > > From {{DataSourceTask.invoke()}}: > {code} > if ((returned = format.nextRecord(serializer.createInstance())) != null) { > output.collect(returned); > } > {code} > The returned value ({{returned}}) must be copied rather than creating and > passing in a new instance. The {{InputFormat}} interface only permits the > given object to be used and does not require a new object to be returned > otherwise. -- This message was sent by Atlassian JIRA (v6.3.4#6332)