kamalcph commented on code in PR #21089:
URL: https://github.com/apache/kafka/pull/21089#discussion_r2625662967


##########
storage/src/main/java/org/apache/kafka/storage/internals/log/RemoteIndexCache.java:
##########
@@ -138,10 +165,21 @@ public void resizeCacheSize(long 
remoteLogIndexFileCacheSize) {
         }
     }
 
-    private Cache<Uuid, Entry> initEmptyCache(long maxSize) {
-        return Caffeine.newBuilder()
+    private Cache<Uuid, Entry> initEmptyCache(long maxSize, long ttlMs, Ticker 
ticker) {
+        Caffeine<Uuid, Entry> builder = Caffeine.newBuilder()
                 .maximumWeight(maxSize)
-                .weigher((Uuid key, Entry entry) -> (int) entry.entrySizeBytes)
+                .recordStats()
+                .weigher((Uuid key, Entry entry) -> (int) 
entry.entrySizeBytes);
+
+        if (ticker != null) {
+            builder.ticker(ticker);
+        }
+
+        if (ttlMs > 0) {
+            builder.expireAfterAccess(ttlMs, 
java.util.concurrent.TimeUnit.MILLISECONDS);

Review Comment:
   can we add an import for `java.util.concurrent.TimeUnit`?



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