dlg99 commented on code in PR #3522:
URL: https://github.com/apache/bookkeeper/pull/3522#discussion_r997380459


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieImpl.java:
##########
@@ -112,8 +113,8 @@ public class BookieImpl extends BookieCriticalThread 
implements Bookie {
 
     private int exitCode = ExitCode.OK;
 
-    private final ConcurrentLongHashMap<byte[]> masterKeyCache =
-            ConcurrentLongHashMap.<byte[]>newBuilder().build();
+    private final Cache<Long, byte[]> masterKeyCache = 
CacheBuilder.newBuilder().
+            expireAfterAccess(60, TimeUnit.MINUTES).build();

Review Comment:
   there is Caffeine Cache which claims better perf but I don't know if it 
behaves any better in this case. 
   You can as well switch to expireAfterWrite, make it configurable and let 
users set it. 
   Pulsar has configuration for time based ledger rollover, just have to set it 
is lower than the expireAfterWrite value in bk.



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