shanzi commented on code in PR #16545:
URL: https://github.com/apache/iceberg/pull/16545#discussion_r3329808008


##########
flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/source/reader/ArrayBatchRecords.java:
##########
@@ -168,4 +168,14 @@ public static <T> ArrayBatchRecords<T> forRecords(
   public static <T> ArrayBatchRecords<T> finishedSplit(String splitId) {
     return new ArrayBatchRecords<>(null, null, null, 0, 0, 0, 
Collections.singleton(splitId));
   }
+
+  /**
+   * Create an empty ArrayBatchRecords with no records and no finished splits. 
This is returned when
+   * the reader is woken up (e.g. during shutdown) while waiting for an 
array-pool entry, so that
+   * {@link 
org.apache.flink.connector.base.source.reader.splitreader.SplitReader#fetch()} 
returns
+   * control and stays reentrant.
+   */
+  public static <T> ArrayBatchRecords<T> emptyBatch() {
+    return new ArrayBatchRecords<>(null, null, null, 0, 0, 0, 
Collections.emptySet());

Review Comment:
   Empty finished splits is required when it is waken up by watermark alignment.



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