stevenzwu commented on code in PR #4943:
URL: https://github.com/apache/iceberg/pull/4943#discussion_r892573554


##########
flink/v1.15/flink/src/main/java/org/apache/iceberg/flink/source/StreamingMonitorFunction.java:
##########
@@ -154,14 +179,28 @@ private void monitorAndForwardSplits() {
       ScanContext newScanContext;
       if (lastSnapshotId == INIT_LAST_SNAPSHOT_ID) {
         newScanContext = scanContext.copyWithSnapshotId(snapshotId);
+        LOG.debug("Start generating splits for {}", snapshotId);
       } else {
+        if (scanContext.maxSnapshotCountPerMonitorInterval() ==
+            
FlinkConfigOptions.MAX_SNAPSHOT_COUNT_PER_MONITOR_INTERVAL_DEFAULT) {
+          snapshotId = snapshot.snapshotId();
+        } else {
+          snapshotId = maxReachableSnapshotId(lastSnapshotId, snapshotId,
+              scanContext.maxSnapshotCountPerMonitorInterval());
+        }
         newScanContext = scanContext.copyWithAppendsBetween(lastSnapshotId, 
snapshotId);
+        LOG.debug("Start generating splits from {}(exclusive) to 
{}(inclusive),", lastSnapshotId, snapshotId);

Review Comment:
   Nit: why not move the debug log outside the if-else block? To me, it is ok 
to use the same log line for the if case too.
   
   Also maybe is "discover" more accurate than "generate" in the log lines?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to