You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2021/08/05 19:26:13 UTC

[GitHub] [solr] madrob commented on a change in pull request #230: SOLR-15555 Improved caching on FilterQuery

madrob commented on a change in pull request #230:
URL: https://github.com/apache/solr/pull/230#discussion_r683729013



##########
File path: solr/core/src/java/org/apache/solr/search/CaffeineCache.java
##########
@@ -190,73 +191,72 @@ public V get(K key) {
     return cache.getIfPresent(key);
   }
 
-  @Override
-  public V computeIfAbsent(K key, IOFunction<? super K, ? extends V> mappingFunction) throws IOException {
-    /*
-    This block will get deleted before commit, but I'm leaving it in for now in case I have to go back to that apporach
+  private V computeAsync(K key, IOFunction<? super K, ? extends V> mappingFunction) throws IOException {
+    // First do a lookup first: optimistic non-locking path.
+    // The cache does this for us on get(K, Function), but not putIfAbsent
+    V value = get(key);
+    if (value != null) {
+      return value;
+    }

Review comment:
       It looks like there's an interesting discrepancy here still, where the get from compute will increment the cache lookups stat, while the get in put will not increment the stat. I'm reading the source for 2.9.4 - I don't think we're ready to go to 3.x yet, although I'll probably do that as soon as I'm done with this issue.




-- 
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: issues-unsubscribe@solr.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org