nicoloboschi commented on a change in pull request #2805:
URL: https://github.com/apache/bookkeeper/pull/2805#discussion_r714833082



##########
File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java
##########
@@ -854,6 +855,28 @@ public int getLostBookieRecoveryDelay() throws 
UnavailableException {
         }
     }
 
+    @Override
+    public void notifyUnderReplicationLedgerChanged(GenericCallback<Void> cb) 
throws UnavailableException {
+        LOG.debug("notifyUnderReplicationLedgerChanged()");
+        Watcher w = new Watcher() {
+            @Override
+            public void process(WatchedEvent e) {
+                if (e.getPath().contains("urL") && e.getType() == 
Event.EventType.NodeDeleted) {

Review comment:
       checking the event type is cheaper than the contains, I suggest to 
invert the conditions order
   
   I think it is better to use `getLedgerId(String path)` method instead of the 
String contains

##########
File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
##########
@@ -691,6 +691,14 @@ public void start() {
                 submitShutdownTask();
             }
 
+            try {
+                
this.ledgerUnderreplicationManager.notifyUnderReplicationLedgerChanged(new 
UnderReplicatedLedgersChangedCb());
+            }catch (UnavailableException ue) {

Review comment:
       missing a space before the 'catch'




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