You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by lvfangmin <gi...@git.apache.org> on 2018/11/26 05:54:54 UTC
[GitHub] zookeeper pull request #722: [ZOOKEEPER-3203] Tracking the number of non vot...
GitHub user lvfangmin opened a pull request:
https://github.com/apache/zookeeper/pull/722
[ZOOKEEPER-3203] Tracking the number of non voting followers in ZK
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/lvfangmin/zookeeper ZOOKEEPER-3203
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zookeeper/pull/722.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #722
----
commit f093c2b6306d86efc5da9ad0834553060f99ae63
Author: Fangmin Lyu <fa...@...>
Date: 2018-11-26T00:41:25Z
[ZOOKEEPER-3203] Track the number of non voting followers in ZK
----
---
[GitHub] zookeeper pull request #722: [ZOOKEEPER-3203] Tracking the number of non vot...
Posted by eolivelli <gi...@git.apache.org>.
Github user eolivelli commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/722#discussion_r237470021
--- Diff: zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LeaderBean.java ---
@@ -51,6 +51,15 @@ public String followerInfo() {
return sb.toString();
}
+ @Override
+ public String nonVotingFollowerInfo() {
+ StringBuilder sb = new StringBuilder();
+ for (LearnerHandler handler : leader.getNonVotingFollowers()) {
+ sb.append(handler.toString()).append("\n");
--- End diff --
Ok I think we can live with it
---
[GitHub] zookeeper pull request #722: [ZOOKEEPER-3203] Tracking the number of non vot...
Posted by lvfangmin <gi...@git.apache.org>.
Github user lvfangmin commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/722#discussion_r237288886
--- Diff: zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LeaderBean.java ---
@@ -51,6 +51,15 @@ public String followerInfo() {
return sb.toString();
}
+ @Override
+ public String nonVotingFollowerInfo() {
+ StringBuilder sb = new StringBuilder();
+ for (LearnerHandler handler : leader.getNonVotingFollowers()) {
+ sb.append(handler.toString()).append("\n");
--- End diff --
That's a fair point, but I'd like to keep the same behavior in this patch as what we're doing now for the followInfo in this LeaderBean.
---
[GitHub] zookeeper pull request #722: [ZOOKEEPER-3203] Tracking the number of non vot...
Posted by eolivelli <gi...@git.apache.org>.
Github user eolivelli commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/722#discussion_r236150403
--- Diff: zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LeaderBean.java ---
@@ -51,6 +51,15 @@ public String followerInfo() {
return sb.toString();
}
+ @Override
+ public String nonVotingFollowerInfo() {
+ StringBuilder sb = new StringBuilder();
+ for (LearnerHandler handler : leader.getNonVotingFollowers()) {
+ sb.append(handler.toString()).append("\n");
--- End diff --
Wouldn't it be better to have a specific toStringForJMX method.
In the future people will change the toString method without thinking that they are changing the output of a public endpoint
---