Github user eolivelli commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/546#discussion_r197497322
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java
---
@@ -2069,4 +2073,9 @@ public QuorumCnxManager createCnxnManager() {
this.quorumCnxnThreadsSize,
this.isQuorumSaslAuthEnabled());
}
+
+ boolean isLeader(long id) {
+ Vote vote = getCurrentVote();
+ return vote != null && id == vote.getId();
--- End diff --
Should I rename the method to isLeaderForJmx or something similar?
I would like to make it clear that this method is only for external
monitoring
---