pnowojski commented on a change in pull request #8442: [FLINK-12483] Support 
(legacy) SourceFunction as special case in the mailbox model for stream tasks
URL: https://github.com/apache/flink/pull/8442#discussion_r285541574
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamIterationHead.java
 ##########
 @@ -66,21 +66,20 @@ public StreamIterationHead(Environment env) {
        // 
------------------------------------------------------------------------
 
        @Override
-       protected boolean performDefaultAction() throws Exception {
+       protected void performDefaultAction(ActionContext context) throws 
Exception {
                StreamRecord<OUT> nextRecord = shouldWait ?
                        dataChannel.poll(iterationWaitTime, 
TimeUnit.MILLISECONDS) :
                        dataChannel.take();
 
-               if (nextRecord == null) {
-                       return false;
-               }
-
-               synchronized (getCheckpointLock()) {
-                       for (RecordWriterOutput<OUT> output : streamOutputs) {
-                               output.collect(nextRecord);
+               if (nextRecord != null) {
 
 Review comment:
   It's a quite common code style convention.
   ```
   if (condition) {
     instruction_1;
     instruction_2;
     ...
     instruction_15;
   }
   else {
     single_instruction;
   }
   ```
   Once you finally get to `else branch`, you might not longer remember what's 
this if all about. If reversed, you can quickly digest and forget the shorter 
branch, before moving to the else, still having fresh in mind what was before 
the `if` and inside the `condition`.
   
   On the other hand, "likely" "unlikely" are:
   - often a fuzzy concepts, that are subject to change and hard to evaluate
   - often it doesn't matter to the reader, since you need to go through both 
branches anyway
   
   But this is a nit, so if you are not convinced do as you are pleased. 

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

Reply via email to