pvary commented on code in PR #9308:
URL: https://github.com/apache/iceberg/pull/9308#discussion_r1431735881


##########
flink/v1.18/flink/src/main/java/org/apache/iceberg/flink/source/reader/IcebergSourceSplitReader.java:
##########
@@ -80,6 +88,35 @@ public RecordsWithSplitIds<RecordAndPosition<T>> fetch() 
throws IOException {
     }
 
     if (currentReader.hasNext()) {
+      if (pausedSplits.contains(currentSplitId)) {
+        // Wait until the reader is unblocked. Wake every second to catch any 
missed signal.
+        // Return empty records if wakeUp is called, so pauseOrResumeSplits 
could be processed.
+        boolean first = true;

Review Comment:
   The code snippet above, and the one proposed by the PR is only different 
because I wanted to add logging to the blocking path, but do not want to swamp 
the log with a new message every second. If you think that the logging is not 
important, the decision is that we accept that we log a line every second on 
INFO level until the SplitReader is unblocked, then we can simplify the code. 
Or we accept that every `fetch()` loop will create and new boolean variable 
which is not used in 90 percent of the cases.
   
   On the hot path I prefer optimized code to simpler code, but the difference 
is probably not too noticeable anyway. 



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to