rizaon commented on code in PR #4518:
URL: https://github.com/apache/iceberg/pull/4518#discussion_r976141635
##########
core/src/main/java/org/apache/iceberg/ManifestFiles.java:
##########
@@ -44,6 +51,28 @@ private ManifestFiles() {}
ManifestFile.PARTITION_SUMMARY_TYPE,
GenericPartitionFieldSummary.class.getName()));
+ private static final Cache<FileIO, ContentCache> CONTENT_CACHES =
+
Caffeine.newBuilder().weakKeys().maximumSize(maxFileIO()).recordStats().build();
Review Comment:
The
[documentation](https://www.javadoc.io/doc/com.github.ben-manes.caffeine/caffeine/2.2.0/com/github/benmanes/caffeine/cache/Caffeine.html)
says
> Entries with reclaimed keys or values may be removed from the cache on
each cache modification, on occasional cache accesses, or on calls to
[Cache.cleanUp()](https://www.javadoc.io/static/com.github.ben-manes.caffeine/caffeine/2.2.0/com/github/benmanes/caffeine/cache/Cache.html#cleanUp--);
Added `testWeakFileIOReferenceCleanUp()` to verify that using `weakKeys()`
can still evicts cache entries.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]