leekeiabstraction commented on code in PR #2061:
URL: https://github.com/apache/fluss/pull/2061#discussion_r2577871284
##########
fluss-client/src/main/java/org/apache/fluss/client/table/scanner/log/ScanRecords.java:
##########
@@ -50,12 +51,11 @@ public ScanRecords(Map<TableBucket, List<ScanRecord>>
records) {
*
* @param scanBucket The bucket to get records for
*/
- public List<ScanRecord> records(TableBucket scanBucket) {
- List<ScanRecord> recs = records.get(scanBucket);
- if (recs == null) {
- return Collections.emptyList();
+ public Iterator<ScanRecord> records(TableBucket scanBucket) {
+ if (records.containsKey(scanBucket)) {
+ return records.get(scanBucket);
}
- return Collections.unmodifiableList(recs);
+ return CloseableIterator.emptyIterator();
Review Comment:
Discussed with @polyzos and came to the same page to leave ScanRecords
interface unchanged.
To confirm: Iterators will only be used within internal components e.g.
FlinkSourceSplitReader and TieringSplitReader
--
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]