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


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieImpl.java:
##########
@@ -477,10 +478,17 @@ public void start() {
             syncThread = new SyncThread(conf, getLedgerDirsListener(), 
ledgerStorage, checkpointSource, statsLogger);
         }
 
+        LedgerStorageNotificationListener storageNotificationListener = new 
LedgerStorageNotificationListener() {
+            @Override
+            public void ledgerRemovedFromStorage(long ledgerId) {
+                masterKeyCache.remove(ledgerId);
+            }
+        };
+
         ledgerStorage.setStateManager(stateManager);
         ledgerStorage.setCheckpointSource(checkpointSource);
         ledgerStorage.setCheckpointer(syncThread);
-
+        
ledgerStorage.addStorageStorageNotificationListener(storageNotificationListener);

Review Comment:
   uodated



##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerStorage.java:
##########
@@ -60,6 +61,8 @@ void initialize(ServerConfiguration conf,
     void setStateManager(StateManager stateManager);
     void setCheckpointSource(CheckpointSource checkpointSource);
     void setCheckpointer(Checkpointer checkpointer);
+    void setMasterKeyCache(ConcurrentLongHashMap<byte[]> masterKeyCache);

Review Comment:
   finished



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