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: pr-unsubscr...@jena.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@jena.apache.org
For additional commands, e-mail: pr-h...@jena.apache.org

Reply via email to