sijie commented on a change in pull request #873: Issue280: Turn bookie into 
readonly when sortedLedgerStorage failed to flush data
URL: https://github.com/apache/bookkeeper/pull/873#discussion_r157659770
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
 ##########
 @@ -862,6 +863,11 @@ public synchronized void start() {
 
         ledgerStorage.start();
 
+        // if ledgerStorage is SortedLedgerStorage, then add 
SortedLedgerStorageListener
+        if (ledgerStorage instanceof SortedLedgerStorage){
+            ((SortedLedgerStorage) 
ledgerStorage).addSortedLedgerStorageListener(getSortedLedgerStorageListener());
 
 Review comment:
   @ArvinDevel an alternative:
   
   - make a StateManager interface, move the state management in Bookie into an 
implementation of `StateManager`. The state manager is taking care of switching 
states of a bookie.
   - pass the StateManager into the ledger storage. different ledger storage 
implementations use this state manager to decide when to switch the state.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to