zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] eolivelli commented on a change in pull request #978: ZOOKEEPER-3421: Better insight into Observer connections
Date Tue, 11 Jun 2019 08:31:18 GMT
eolivelli commented on a change in pull request #978: ZOOKEEPER-3421: Better insight into Observer
connections
URL: https://github.com/apache/zookeeper/pull/978#discussion_r292307644
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/admin/Commands.java
 ##########
 @@ -381,6 +385,28 @@ public CommandResponse run(ZooKeeperServer zkServer, Map<String,
String> kwargs)
 
         }}
 
+    /**
+     * Reset all observer connection statistics.
+     */
+    public static class ObserverCnxnStatResetCommand extends CommandBase {
+        public ObserverCnxnStatResetCommand() {
+            super(Arrays.asList("observer_connection_stat_reset", "orst"));
+        }
+
+        @Override
+        public CommandResponse run(ZooKeeperServer zkServer, Map<String, String> kwargs)
{
+            CommandResponse response = initializeResponse();
+            if (zkServer instanceof LeaderZooKeeperServer) {
+                Leader leader = ((LeaderZooKeeperServer) zkServer).getLeader();
 
 Review comment:
   Why not adding this method to the base parent class and drop 'instanceof'?

----------------------------------------------------------------
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