eolivelli commented on code in PR #3554:
URL: https://github.com/apache/bookkeeper/pull/3554#discussion_r1005442515
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java:
##########
@@ -737,6 +737,40 @@ public boolean isLedgerReplicationEnabled()
}
}
+ @Override
+ public void notifyLedgerReplicationStatusChanged(final
GenericCallback<Void> cb)
+ throws ReplicationException.UnavailableException {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("notifyLedgerReplicationStatusChanged()");
+ }
+ Watcher w = new Watcher() {
+ @Override
+ public void process(WatchedEvent e) {
+ if (e.getType() == Watcher.Event.EventType.NodeDeleted) {
+ LOG.info("aLedgerReplication is enabled externally through
Zookeeper, "
+ + "since DISABLE_NODE ZNode is deleted");
+ cb.operationComplete(0, null);
+ } else if (e.getType() == Watcher.Event.EventType.NodeCreated)
{
+ LOG.info("bLedgerReplication is disabled externally
through Zookeeper, "
+ + "since DISABLE_NODE ZNode is created");
+ cb.operationComplete(1, null);
+ }
+ }
+ };
+ try {
+ zkc.addWatch(basePath + '/'
Review Comment:
We must implement this for every supported Metadata driver
What happens if the driver doesn't implement it?
--
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]