pnowojski commented on a change in pull request #8409: [FLINK-12478] Decompose
monolithic run-loops in StreamTask implementa…
URL: https://github.com/apache/flink/pull/8409#discussion_r285553492
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamIterationHead.java
##########
@@ -41,88 +42,73 @@
private static final Logger LOG =
LoggerFactory.getLogger(StreamIterationHead.class);
- private volatile boolean running = true;
+ private RecordWriterOutput<OUT>[] streamOutputs;
+
+ private final BlockingQueue<StreamRecord<OUT>> dataChannel;
+ private final String brokerID;
+ private final long iterationWaitTime;
+ private final boolean shouldWait;
public StreamIterationHead(Environment env) {
super(env);
+ final String iterationId = getConfiguration().getIterationId();
+ if (iterationId == null || iterationId.length() == 0) {
+ throw new FlinkRuntimeException("Missing iteration ID
in the task configuration");
+ }
+
+ this.dataChannel = new ArrayBlockingQueue<>(1);
+ this.brokerID =
createBrokerIdString(getEnvironment().getJobID(), iterationId,
+ getEnvironment().getTaskInfo().getIndexOfThisSubtask());
+ this.iterationWaitTime =
getConfiguration().getIterationWaitTime();
+ this.shouldWait = iterationWaitTime > 0;
Review comment:
In general I think we should go in the opposite direction: move all of the
initialisation to the constructors, factory methods or builders and make all of
the fields `final`, so I would leave it as it is for now or even go one step
further: make `RecordWriterOutput<OUT>[] streamOutputs` final as well (probably
would require more changes).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services