rvesse commented on code in PR #2524:
URL: https://github.com/apache/jena/pull/2524#discussion_r1630898237
##########
jena-base/src/main/java/org/apache/jena/atlas/lib/cache/CacheCaffeine.java:
##########
@@ -44,12 +44,18 @@ public CacheCaffeine(int size) {
}
public CacheCaffeine(int size, BiConsumer<K, V> dropHandler) {
+ this(size, dropHandler, -1);
+ }
+
+ public CacheCaffeine(int size, BiConsumer<K, V> dropHandler, double
initialCapacityFactor) {
@SuppressWarnings("unchecked")
Caffeine<K,V> builder = (Caffeine<K,V>)Caffeine.newBuilder()
- .maximumSize(size)
- .initialCapacity(size/4)
- // Eviction immediately using the caller thread.
- .executor(c->c.run());
+ .maximumSize(size);
+ if (initialCapacityFactor > 0.0) {
Review Comment:
Also needs an upper bound of `1.0` here otherwise you could try and set the
initial capacity higher than the maximum size
--
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]