loserwang1024 commented on code in PR #4101:
URL: https://github.com/apache/flink-cdc/pull/4101#discussion_r2342847836


##########
flink-cdc-connect/flink-cdc-source-connectors/flink-cdc-base/src/main/java/org/apache/flink/cdc/connectors/base/source/reader/external/Fetcher.java:
##########
@@ -33,7 +34,7 @@
 public interface Fetcher<T, Split> {
 
     /** Add to task to fetch, this should call only when the reader is idle. */
-    void submitTask(FetchTask<Split> fetchTask);
+    Future<?> submitTask(FetchTask<Split> fetchTask);

Review Comment:
   >  wonder why we need to modify the public API in incremental API 
   
   Yes, I do this for test now. When I want to test this 
exception(IncrementalSourceStreamFetcherTest#testReadBinlogWithException). I 
don't know when the `fetcher.submitTask` is finish. (Sleep is also a choice, 
but I think is unstable).
   
   Only we make sure `fetcher.submitTask` is finish, the logical before will 
return null( in pollRecordsFromReader method).Otherwise, they will behave as 
same, this test is no meaning. 
   
   > this Future works like a trigger and returns nothing. Use Future<Void> 
instead?
   
   Just same as 
`java.util.concurrent.ExecutorService#submit(java.lang.Runnable)` which return 
Future<?>
   <img width="847" height="345" alt="image" 
src="https://github.com/user-attachments/assets/e4cd9f93-1137-4561-981c-46ffcf53b05d";
 />
   
   



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