xishuaidelin commented on code in PR #2510:
URL: https://github.com/apache/fluss/pull/2510#discussion_r2745433452
##########
fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/source/enumerator/FlinkSourceEnumeratorTest.java:
##########
@@ -759,6 +760,52 @@ void testPartitionsExpiredInFlussButExistInLake(
}
}
+ @Test
+ void testReportBacklogStatus() throws Throwable {
+ long tableId = createTable(DEFAULT_TABLE_PATH,
DEFAULT_PK_TABLE_DESCRIPTOR);
+ int numSubtasks = 3;
+
+ try (MockBacklogSplitEnumeratorContext context =
+ new MockBacklogSplitEnumeratorContext(numSubtasks)) {
+ FlinkSourceEnumerator enumerator =
+ new FlinkSourceEnumerator(
+ DEFAULT_TABLE_PATH,
+ flussConf,
+ true,
+ false,
+ context,
+ OffsetsInitializer.full(),
+ DEFAULT_SCAN_PARTITION_DISCOVERY_INTERVAL_MS,
+ streaming,
+ null,
+ null);
+ enumerator.start();
+ assertThat(context.isProcessingBacklogCalled()).isTrue();
+
+ // Register readers
+ for (int i = 0; i < numSubtasks; i++) {
+ registerReader(context, enumerator, i);
+ }
+
+ context.runNextOneTimeCallable();
+
+ // Simulate BacklogFinishEvent from reader
+ TableBucket bucket0 = new TableBucket(tableId, 0);
+ TableBucket bucket1 = new TableBucket(tableId, 1);
+ TableBucket bucket2 = new TableBucket(tableId, 2);
+
+ BacklogFinishEvent event0 = new BacklogFinishEvent(bucket0);
+ BacklogFinishEvent event1 = new BacklogFinishEvent(bucket1);
+ BacklogFinishEvent event2 = new BacklogFinishEvent(bucket2);
+
+ enumerator.handleSourceEvent(0, event0);
+ enumerator.handleSourceEvent(1, event1);
+ enumerator.handleSourceEvent(2, event2);
+
+ assertThat(context.isProcessingBacklogCalled()).isFalse();
+ }
+ }
Review Comment:
Already added the actual data.
--
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]