zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] enixon commented on a change in pull request #940: ZOOKEEPER-3386: Add admin command to display voting view
Date Sun, 12 May 2019 20:08:13 GMT
enixon commented on a change in pull request #940: ZOOKEEPER-3386: Add admin command to display
voting view
URL: https://github.com/apache/zookeeper/pull/940#discussion_r283152223
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/admin/Commands.java
 ##########
 @@ -573,5 +574,27 @@ public CommandResponse run(ZooKeeperServer zkServer, Map<String,
String> kwargs)
         }
     }
 
+    /**
+     * Returns the current ensemble configuration information.
+     * It provides list of current voting members in the ensemble.
+     */
+    public static class VotingViewCommand extends CommandBase {
+        public VotingViewCommand() {
+            super(Arrays.asList("voting_view"));
+        }
+
+        @Override
+        public CommandResponse run(ZooKeeperServer zkServer, Map<String, String> kwargs)
{
+            CommandResponse response = initializeResponse();
+            if (zkServer instanceof QuorumZooKeeperServer) {
+                QuorumPeer peer = ((QuorumZooKeeperServer) zkServer).self;
+                response.put("current_config", peer.getVotingView());
 
 Review comment:
   That's a legitimate question and I don't know if I have the certain answer.
   
   My thoughts are that jmx is clearly awesome at two things:
   1. exposing internal feature flags and settings for review and alteration and
   2. the execution of commands that require parameters.
   
   The admin command is clearly awesome at one thing:
   1. presenting complicated diagnostic information.
   
   This feature easily falls into the second category (jmx is certainly not going to alter
the voting view). I don't know enough about the history of the admin command to know if the
division I outline above is the same as the one seen by the community. 
   
   The other thing on my mind is that some users of ZooKeeper will opt out of jmx entirely
because of the security concerns about the library. It would be generous to not shut them
and their managing frameworks out of certain auditing information.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message