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_r292336904
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/admin/Commands.java
 ##########
 @@ -496,6 +522,43 @@ public CommandResponse run(ZooKeeperServer zkServer, Map<String,
String> kwargs)
         }
     }
 
+    /**
+     * Information on observer connections to server. Returned Map contains:
+     *   - "synced_observers": Integer (leader/follower only)
+     *   - "observers": list of observer learner handler info objects (leader/follower only)
+     * @see org.apache.zookeeper.server.quorum.LearnerHandler#getLearnerHandlerInfo()
+     */
+    public static class SyncedObserverConsCommand extends CommandBase {
+        public SyncedObserverConsCommand() {
+            super(Arrays.asList("observers", "obsr"));
+        }
+
+        @Override
+        public CommandResponse run(ZooKeeperServer zkServer, Map<String, String> kwargs)
{
+
+            CommandResponse response = initializeResponse();
+
+            if (zkServer instanceof LeaderZooKeeperServer) {
 
 Review comment:
   Same here.
   Anyway the whole file is full of instanceof
   
   We can do it in a separate change

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