rishabhdaim commented on code in PR #2842:
URL: https://github.com/apache/jackrabbit-oak/pull/2842#discussion_r3068076866


##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticIndexStatistics.java:
##########
@@ -208,25 +191,13 @@ private Long getCacheRefreshSeconds() {
         return Long.getLong(REFRESH_SECONDS, REFRESH_SECONDS_DEFAULT);
     }
 
-    static class CountCacheLoader extends CacheLoader<StatsRequestDescriptor, 
Integer> {
+    static class CountCacheLoader implements 
CacheLoader<StatsRequestDescriptor, Integer> {
 
         @Override
         public @NotNull Integer load(@NotNull StatsRequestDescriptor 
countRequestDescriptor) throws IOException {
             return count(countRequestDescriptor);
         }
 
-        @Override
-        public @NotNull ListenableFuture<Integer> reload(@NotNull 
StatsRequestDescriptor crd, @NotNull Integer oldValue) {
-            CompletableFuture<Integer> task = CompletableFuture.supplyAsync(() 
-> {
-                try {
-                    return count(crd);
-                } catch (IOException e) {
-                    throw new CompletionException(e);
-                }
-            }, REFRESH_EXECUTOR);
-            return FutureConverter.toListenableFuture(task);
-        }
-

Review Comment:
   no need for reload for caffeince cache, it handles that part internally.



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

Reply via email to