shangxinli commented on code in PR #20383:
URL: https://github.com/apache/hudi/pull/20383#discussion_r4316652474
##########
hudi-common/src/main/java/org/apache/hudi/core/read/BaseHoodieTableFileIndex.java:
##########
@@ -239,32 +297,51 @@ public List<PartitionPath> getAllQueryPartitionPaths() {
* Returns all listed file-slices w/in the partition paths returned by
{@link #getAllQueryPartitionPaths()}
*/
protected Map<PartitionPath, List<FileSlice>> getAllInputFileSlices() {
- if (!areAllFileSlicesCached()) {
- ensurePreloadedPartitions(getAllQueryPartitionPaths());
- }
-
- return cachedAllInputFileSlices;
+ // NOTE: We always hand out a freshly assembled snapshot rather than the
cache itself: the cache is mutated (and
+ // evicted from) by every subsequent query, so returning it would
alias the caller's result to live state.
+ return getInputFileSlices(getAllQueryPartitionPaths().toArray(new
PartitionPath[0]));
Review Comment:
That wording covers it, thanks. One leftover worth a note on the method:
areAllFileSlicesCached can now go false right away once the cache evicts, and
its only remaining caller is the skipping-ratio log in HoodieFileIndex at line
316, so a table that overflows the budget just logs -1 instead of a ratio.
--
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]