@Override public void commandRun() { if (!isZKServerRunning()) { pw.println(ZK_NOT_SERVING); } else { pw.print("Zookeeper version: "); pw.println(Version.getFullVersion()); if (zkServer instanceof ReadOnlyZooKeeperServer) { pw.println("READ-ONLY mode; serving only read-only clients"); } if (len == FourLetterCommands.statCmd) { LOG.info("Stat command output"); pw.println("Clients:"); for(ServerCnxn c : factory.getConnections()){ c.dumpConnectionInfo(pw, true); pw.println(); } pw.println(); } pw.print(zkServer.serverStats().toString()); pw.print("Node count: "); pw.println(zkServer.getZKDatabase().getNodeCount()); } }
@Override public void commandRun() { if (zkServer == null) { pw.println(ZK_NOT_SERVING); } else { pw.print("Zookeeper version: "); pw.println(Version.getFullVersion()); if (zkServer instanceof ReadOnlyZooKeeperServer) { pw.println("READ-ONLY mode; serving only read-only clients"); } if (len == FourLetterCommands.statCmd) { LOG.info("Stat command output"); pw.println("Clients:"); for(ServerCnxn c : factory.getConnections()){ c.dumpConnectionInfo(pw, true); pw.println(); } pw.println(); } pw.print(zkServer.serverStats().toString()); pw.print("Node count: "); pw.println(zkServer.getZKDatabase().getNodeCount()); } }
@Override public void commandRun() { if (zkServer == null) { pw.println(ZK_NOT_SERVING); } else { pw.print("Zookeeper version: "); pw.println(Version.getFullVersion()); if (zkServer instanceof ReadOnlyZooKeeperServer) { pw.println("READ-ONLY mode; serving only " + "read-only clients"); } if (len == statCmd) { LOG.info("Stat command output"); pw.println("Clients:"); // clone should be faster than iteration // ie give up the cnxns lock faster HashSet<ServerCnxn> cnxns; synchronized(factory.cnxns){ cnxns = new HashSet<ServerCnxn>(factory.cnxns); } for(ServerCnxn c : cnxns){ c.dumpConnectionInfo(pw, true); pw.println(); } pw.println(); } pw.print(zkServer.serverStats().toString()); pw.print("Node count: "); pw.println(zkServer.getZKDatabase().getNodeCount()); } }
@Override public void commandRun() { if (zkServer == null) { pw.print("null"); } else if (zkServer instanceof ReadOnlyZooKeeperServer) { pw.print("ro"); } else { pw.print("rw"); } }
@SuppressWarnings("unchecked") @Override public void commandRun() { if (zkServer == null) { pw.println(ZK_NOT_SERVING); } else { pw.print("Zookeeper version: "); pw.println(Version.getFullVersion()); if (zkServer instanceof ReadOnlyZooKeeperServer) { pw.println("READ-ONLY mode; serving only " + "read-only clients"); } if (len == statCmd) { LOG.info("Stat command output"); pw.println("Clients:"); // clone should be faster than iteration // ie give up the cnxns lock faster HashSet<NIOServerCnxn> cnxnset; synchronized(factory.cnxns){ cnxnset = (HashSet<NIOServerCnxn>)factory .cnxns.clone(); } for(NIOServerCnxn c : cnxnset){ c.dumpConnectionInfo(pw, true); pw.println(); } pw.println(); } pw.print(zkServer.serverStats().toString()); pw.print("Node count: "); pw.println(zkServer.getZKDatabase().getNodeCount()); } }
@Override public CommandResponse run(ZooKeeperServer zkServer, Map<String, String> kwargs) { CommandResponse response = initializeResponse(); LOG.info("running stat"); response.put("version", Version.getFullVersion()); response.put("read_only", zkServer instanceof ReadOnlyZooKeeperServer); response.put("server_stats", zkServer.serverStats()); response.put("node_count", zkServer.getZKDatabase().getNodeCount()); return response; }
@Override public void commandRun() { if (!isZKServerRunning()) { pw.print("null"); } else if (zkServer instanceof ReadOnlyZooKeeperServer) { pw.print("ro"); } else { pw.print("rw"); } }
@Override public void commandRun() { if (!isZKServerRunning()) { pw.println(ZK_NOT_SERVING); } else { pw.print("Zookeeper version: "); pw.println(Version.getFullVersion()); if (zkServer instanceof ReadOnlyZooKeeperServer) { pw.println("READ-ONLY mode; serving only " + "read-only clients"); } if (len == statCmd) { LOG.info("Stat command output"); pw.println("Clients:"); // clone should be faster than iteration // ie give up the cnxns lock faster HashSet<ServerCnxn> cnxns; synchronized(factory.cnxns){ cnxns = new HashSet<ServerCnxn>(factory.cnxns); } for(ServerCnxn c : cnxns){ c.dumpConnectionInfo(pw, true); pw.println(); } pw.println(); } pw.print(zkServer.serverStats().toString()); pw.print("Node count: "); pw.println(zkServer.getZKDatabase().getNodeCount()); } }
@SuppressWarnings("unchecked") @Override public void commandRun() { if (!isZKServerRunning()) { pw.println(ZK_NOT_SERVING); } else { pw.print("Zookeeper version: "); pw.println(Version.getFullVersion()); if (zkServer instanceof ReadOnlyZooKeeperServer) { pw.println("READ-ONLY mode; serving only " + "read-only clients"); } if (len == statCmd) { LOG.info("Stat command output"); pw.println("Clients:"); // clone should be faster than iteration // ie give up the cnxns lock faster HashSet<NIOServerCnxn> cnxnset; synchronized(factory.cnxns){ cnxnset = (HashSet<NIOServerCnxn>)factory .cnxns.clone(); } for(NIOServerCnxn c : cnxnset){ c.dumpConnectionInfo(pw, true); pw.println(); } pw.println(); } pw.print(zkServer.serverStats().toString()); pw.print("Node count: "); pw.println(zkServer.getZKDatabase().getNodeCount()); } }
@Override public void commandRun() { if (zkServer == null) { pw.println(ZK_NOT_SERVING); } else { pw.print("Zookeeper version: "); pw.println(Version.getFullVersion()); if (zkServer instanceof ReadOnlyZooKeeperServer) { pw.println("READ-ONLY mode; serving only " + "read-only clients"); } if (len == statCmd) { LOG.info("Stat command output"); pw.println("Clients:"); // clone should be faster than iteration // ie give up the cnxns lock faster HashSet<ServerCnxn> cnxns; synchronized(factory.cnxns){ cnxns = new HashSet<ServerCnxn>(factory.cnxns); } for(ServerCnxn c : cnxns){ c.dumpConnectionInfo(pw, true); } pw.println(); } pw.print(zkServer.serverStats().toString()); pw.print("Node count: "); pw.println(zkServer.getZKDatabase().getNodeCount()); } }
@SuppressWarnings("unchecked") @Override public void commandRun() { if (zkServer == null) { pw.println(ZK_NOT_SERVING); } else { pw.print("Zookeeper version: "); pw.println(Version.getFullVersion()); if (zkServer instanceof ReadOnlyZooKeeperServer) { pw.println("READ-ONLY mode; serving only " + "read-only clients"); } if (len == statCmd) { LOG.info("Stat command output"); pw.println("Clients:"); // clone should be faster than iteration // ie give up the cnxns lock faster HashSet<NIOServerCnxn> cnxnset; synchronized(factory.cnxns){ cnxnset = (HashSet<NIOServerCnxn>)factory .cnxns.clone(); } for(NIOServerCnxn c : cnxnset){ c.dumpConnectionInfo(pw, true); } pw.println(); } pw.print(zkServer.serverStats().toString()); pw.print("Node count: "); pw.println(zkServer.getZKDatabase().getNodeCount()); } }