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


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieImpl.java:
##########
@@ -112,8 +113,9 @@ public class BookieImpl extends BookieCriticalThread 
implements Bookie {
 
     private int exitCode = ExitCode.OK;
 
-    private final ConcurrentLongHashMap<byte[]> masterKeyCache =
-            ConcurrentLongHashMap.<byte[]>newBuilder().build();
+    // key: masterKey, values: set of ledgerId
+    private final static ConcurrentOpenHashMap<byte[], ConcurrentLongHashSet> 
masterKeyCache

Review Comment:
   @dlg99 
   use this structure ConcurrentOpenHashMap, the key is masterKey, the value is 
the set of ledgerIds,
   the masterKey settings are different, 
   1. which increases the time-consuming of remove, but the remove operation is 
timed, not so frequent
   2. when we add the new data ,we can use `containsMasterKeyCache` to spead up 
weather to `addMasterKeyCache`



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