eolivelli commented on code in PR #3361:
URL: https://github.com/apache/bookkeeper/pull/3361#discussion_r915544927
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java:
##########
@@ -154,6 +155,30 @@ private void handleMetadata(Versioned<LedgerMetadata>
result, Throwable exceptio
}
}
+ /**
+ * CancelWatchLedgerMetadataTask class.
+ */
+ protected class CancelWatchLedgerMetadataTask implements Runnable {
+
+ final long ledgerId;
+
+ CancelWatchLedgerMetadataTask(long ledgerId) {
+ this.ledgerId = ledgerId;
+ }
+
+ @Override
+ public void run() {
+ Set<LedgerMetadataListener> listeners =
AbstractZkLedgerManager.this.listeners.get(ledgerId);
Review Comment:
this is running in the same thread of "unregisterLedgerMetadataListener"
why do you need a inner class ? can't we simply code this as a regular Java
method ?
```
private void cancelLedgerWatchers(long ledgerId) {
....
}
```
and call it from unregisterLedgerMetadataListener ?
--
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]