renatoh commented on code in PR #4516:
URL: https://github.com/apache/solr/pull/4516#discussion_r3448912212


##########
solr/core/src/java/org/apache/solr/update/processor/TemplateUpdateProcessorFactory.java:
##########
@@ -79,7 +79,7 @@ protected String getMyName() {
 
   public static Resolved getResolved(
       String template, Cache<String, Resolved> cache, Pattern pattern) {
-    Resolved r = cache == null ? null : cache.get(template);
+    Resolved r = cache == null ? null : cache.getIfPresent(template);

Review Comment:
   @dsmiley 
   With Caffeine-Cache we could do this fetch and then the put as an atomic 
operation:
   
https://javadoc.io/static/com.github.ben-manes.caffeine/caffeine/2.9.0/com/github/benmanes/caffeine/cache/Cache.html#get-K-java.util.function.Function
   What do you think?
   



-- 
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]

Reply via email to