StefanRRichter 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_r284664043
 
 

 ##########
 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 not a bad idea, but how can I assign to `final` fields from an 
init method?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to