1996fanrui commented on code in PR #22925:
URL: https://github.com/apache/flink/pull/22925#discussion_r1254573026


##########
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/SourceOperator.java:
##########
@@ -146,7 +146,9 @@ public class SourceOperator<OUT, SplitT extends 
SourceSplit> extends AbstractStr
 
     private DataOutput<OUT> lastInvokedOutput;
 
-    private long lastEmittedWatermark = Watermark.UNINITIALIZED.getTimestamp();
+    private long latestWatermark = Watermark.UNINITIALIZED.getTimestamp();
+
+    private boolean isIdle = false;

Review Comment:
   Thanks for your review!
   
   I prefer keep the `isIdle` instead of `idle`, because:
   1. `isIdle` is more clear than `idle` here, it indicates whether the 
`SourceOperator` is idle or not.
   2. I have tried to generate the getter method by IDEA automatically, the 
method name is `isIdle()`. The method name of getter is:
       - When the field isn't boolean or Boolean, the method name is `getXxx`
       - When the field is boolean or Boolean, the method name is `isXxx`
       - When the prefix of field name is `is`, the method name doesn't contain 
2 `is`
   3. `WatermarkToDataOutput` calls the `SourceOperator#updateIdle`, and 
`WatermarkToDataOutput` has the `isIdle`[1].
   4. Too many boolean fields name in flink are `isXxx`, such as:
       - PipelinedSubpartition#isFinished, PipelinedSubpartition#isReleased
       - NettyShuffleEnvironment#isClosed
       - Their getter method is the filed name.
   
   Of course, I see too many `boolean released`, `boolean closed` as well, if 
you think `idle` is more reasonable here, I can update. 
   
   
   
   [1] 
https://github.com/apache/flink/blob/2de0711a59f58fe34877c6a3ba3ca0b71a1be7a1/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/source/WatermarkToDataOutput.java#L41
    
   
   



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to