merlimat commented on code in PR #3522:
URL: https://github.com/apache/bookkeeper/pull/3522#discussion_r995219352
##########
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:
This will also mean that we have to acquire a write lock each time to update
the last access time. And The cache implementation has to do the extra work for
the eviction.
--
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]