[FLINK-3467] [runtime] Remove superfluous objects from DataSourceTask.invoke
This closes #1691 Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/4870fd62 Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/4870fd62 Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/4870fd62 Branch: refs/heads/master Commit: 4870fd62f0b8bfcc280aa326ffe948a119de6baf Parents: e719eddb Author: Greg Hogan <[email protected]> Authored: Mon Feb 22 11:21:40 2016 -0500 Committer: Stephan Ewen <[email protected]> Committed: Sun Mar 13 16:03:04 2016 +0100 ---------------------------------------------------------------------- .../apache/flink/runtime/operators/DataSourceTask.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/4870fd62/flink-runtime/src/main/java/org/apache/flink/runtime/operators/DataSourceTask.java ---------------------------------------------------------------------- diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/operators/DataSourceTask.java b/flink-runtime/src/main/java/org/apache/flink/runtime/operators/DataSourceTask.java index 960faf7..5eec40f 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/operators/DataSourceTask.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/operators/DataSourceTask.java @@ -136,26 +136,19 @@ public class DataSourceTask<OT> extends AbstractInvokable { final Collector<OT> output = this.output; if (objectReuseEnabled) { - OT reuse1 = serializer.createInstance(); - OT reuse2 = serializer.createInstance(); - OT reuse3 = serializer.createInstance(); + OT reuse = serializer.createInstance(); // as long as there is data to read while (!this.taskCanceled && !format.reachedEnd()) { OT returned; - if ((returned = format.nextRecord(reuse1)) != null) { + if ((returned = format.nextRecord(reuse)) != null) { output.collect(returned); - - reuse1 = reuse2; - reuse2 = reuse3; - reuse3 = returned; } } } else { // as long as there is data to read while (!this.taskCanceled && !format.reachedEnd()) { - OT returned; if ((returned = format.nextRecord(serializer.createInstance())) != null) { output.collect(returned);
