danny0405 commented on code in PR #12608:
URL: https://github.com/apache/hudi/pull/12608#discussion_r1920931083


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/format/FormatUtils.java:
##########
@@ -237,10 +240,14 @@ private List<HoodieProducer<HoodieRecord<?>>> 
getParallelProducers(
     ) {
       List<HoodieProducer<HoodieRecord<?>>> producers = new ArrayList<>();
       producers.add(new FunctionBasedQueueProducer<>(queue -> {
-        HoodieUnMergedLogRecordScanner scanner =
-            
scannerBuilder.withLogRecordScannerCallback(queue::insertRecord).build();
-        // Scan all the delta-log files, filling in the queue
-        scanner.scan();
+        HoodieUnMergedLogRecordScanner scanner = scannerBuilder.build();
+        try (ClosableIterator<HoodieRecord<?>> logRecordIterator = 
scanner.iterator()) {
+          while (logRecordIterator.hasNext()) {
+            queue.insertRecord(logRecordIterator.next());

Review Comment:
   We can remove the whole producers and queue I think.



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