j1wonpark opened a new pull request, #4146: URL: https://github.com/apache/amoro/pull/4146
## Why are the changes needed? `NodeFileScanTask.dataTasks()` creates a new `ArrayList` via `Stream.concat().collect(toList())` on every call, even though the contents are immutable after construction. This method is called repeatedly in hot paths -- `BasicKeyedTableScan.split()` (2x), `AbstractKeyedDataReader.readData()`, and `readDeletedData()` (2x) -- causing unnecessary object allocation and GC pressure during scan operations. ## Brief change log - Added lazy caching to `NodeFileScanTask.dataTasks()` with a `cachedDataTasks` field - Wrapped the cached result with `Collections.unmodifiableList()` to prevent external mutation - Added cache invalidation (`cachedDataTasks = null`) in `addFile()` to ensure correctness when tasks are added after construction ## How was this patch tested? - [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [x] Run test locally before making a pull request ## Documentation - Does this pull request introduce a new feature? no - If yes, how is the feature documented? not applicable -- 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]
