dlmarion commented on code in PR #5256:
URL: https://github.com/apache/accumulo/pull/5256#discussion_r1920350342
##########
core/src/main/java/org/apache/accumulo/core/fate/zookeeper/ZooCache.java:
##########
@@ -152,53 +189,53 @@ public void process(WatchedEvent event) {
break;
}
- externalWatcher.ifPresent(w -> w.accept(event));
+ externalWatchers.forEach(ew -> ew.accept(event));
}
}
- /**
- * Creates a new cache without an external watcher.
- *
- * @param zk the ZooKeeper instance
- * @throws NullPointerException if zk is {@code null}
- */
- public ZooCache(ZooSession zk) {
- this(zk, Optional.empty(), Duration.ofMinutes(3));
+ public ZooCache(ZooSession zk, String root, ZooCacheWatcher... watchers) {
+ this.zk = requireNonNull(zk);
+ for (ZooCacheWatcher zcw : watchers) {
+ externalWatchers.add(zcw);
+ }
+ setupWatchers(requireNonNull(root));
Review Comment:
I have no issue abandoning this. It wasn't a total loss, we found an
existing issue and learned some things along the way.
--
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]