Java 类org.apache.zookeeper.server.quorum.ReadOnlyZooKeeperServer 实例源码

项目:https-github.com-apache-zookeeper    文件:StatCommand.java   
@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());
    }
}
项目:SecureKeeper    文件:StatCommand.java   
@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());
    }
}
项目:SecureKeeper    文件:StatCommand.java   
@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());
    }
}
项目:fuck_zookeeper    文件:NettyServerCnxn.java   
@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());
    }

}
项目:fuck_zookeeper    文件:NettyServerCnxn.java   
@Override
public void commandRun() {
    if (zkServer == null) {
        pw.print("null");
    } else if (zkServer instanceof ReadOnlyZooKeeperServer) {
        pw.print("ro");
    } else {
        pw.print("rw");
    }
}
项目:fuck_zookeeper    文件:NIOServerCnxn.java   
@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());
    }

}
项目:fuck_zookeeper    文件:NIOServerCnxn.java   
@Override
public void commandRun() {
    if (zkServer == null) {
        pw.print("null");
    } else if (zkServer instanceof ReadOnlyZooKeeperServer) {
        pw.print("ro");
    } else {
        pw.print("rw");
    }
}
项目:https-github.com-apache-zookeeper    文件:Commands.java   
@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;

}
项目:https-github.com-apache-zookeeper    文件:IsroCommand.java   
@Override
public void commandRun() {
    if (!isZKServerRunning()) {
        pw.print("null");
    } else if (zkServer instanceof ReadOnlyZooKeeperServer) {
        pw.print("ro");
    } else {
        pw.print("rw");
    }
}
项目:ZooKeeper    文件:NettyServerCnxn.java   
@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());
    }

}
项目:ZooKeeper    文件:NettyServerCnxn.java   
@Override
public void commandRun() {
    if (!isZKServerRunning()) {
        pw.print("null");
    } else if (zkServer instanceof ReadOnlyZooKeeperServer) {
        pw.print("ro");
    } else {
        pw.print("rw");
    }
}
项目:ZooKeeper    文件:NIOServerCnxn.java   
@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());
    }

}
项目:ZooKeeper    文件:NIOServerCnxn.java   
@Override
public void commandRun() {
    if (!isZKServerRunning()) {
        pw.print("null");
    } else if (zkServer instanceof ReadOnlyZooKeeperServer) {
        pw.print("ro");
    } else {
        pw.print("rw");
    }
}
项目:StreamProcessingInfrastructure    文件:NettyServerCnxn.java   
@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());
    }

}
项目:StreamProcessingInfrastructure    文件:NettyServerCnxn.java   
@Override
public void commandRun() {
    if (zkServer == null) {
        pw.print("null");
    } else if (zkServer instanceof ReadOnlyZooKeeperServer) {
        pw.print("ro");
    } else {
        pw.print("rw");
    }
}
项目:StreamProcessingInfrastructure    文件:NIOServerCnxn.java   
@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());
    }

}
项目:StreamProcessingInfrastructure    文件:NIOServerCnxn.java   
@Override
public void commandRun() {
    if (zkServer == null) {
        pw.print("null");
    } else if (zkServer instanceof ReadOnlyZooKeeperServer) {
        pw.print("ro");
    } else {
        pw.print("rw");
    }
}
项目:bigstreams    文件:NettyServerCnxn.java   
@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());
    }

}
项目:bigstreams    文件:NettyServerCnxn.java   
@Override
public void commandRun() {
    if (zkServer == null) {
        pw.print("null");
    } else if (zkServer instanceof ReadOnlyZooKeeperServer) {
        pw.print("ro");
    } else {
        pw.print("rw");
    }
}
项目:bigstreams    文件:NIOServerCnxn.java   
@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());
    }

}
项目:bigstreams    文件:NIOServerCnxn.java   
@Override
public void commandRun() {
    if (zkServer == null) {
        pw.print("null");
    } else if (zkServer instanceof ReadOnlyZooKeeperServer) {
        pw.print("ro");
    } else {
        pw.print("rw");
    }
}
项目:bigstreams    文件:NettyServerCnxn.java   
@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());
    }

}
项目:bigstreams    文件:NettyServerCnxn.java   
@Override
public void commandRun() {
    if (zkServer == null) {
        pw.print("null");
    } else if (zkServer instanceof ReadOnlyZooKeeperServer) {
        pw.print("ro");
    } else {
        pw.print("rw");
    }
}
项目:bigstreams    文件:NIOServerCnxn.java   
@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());
    }

}
项目:bigstreams    文件:NIOServerCnxn.java   
@Override
public void commandRun() {
    if (zkServer == null) {
        pw.print("null");
    } else if (zkServer instanceof ReadOnlyZooKeeperServer) {
        pw.print("ro");
    } else {
        pw.print("rw");
    }
}
项目:zookeeper-src-learning    文件:NettyServerCnxn.java   
@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());
    }

}
项目:zookeeper-src-learning    文件:NettyServerCnxn.java   
@Override
public void commandRun() {
    if (zkServer == null) {
        pw.print("null");
    } else if (zkServer instanceof ReadOnlyZooKeeperServer) {
        pw.print("ro");
    } else {
        pw.print("rw");
    }
}
项目:zookeeper-src-learning    文件:NIOServerCnxn.java   
@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());
    }

}
项目:zookeeper-src-learning    文件:NIOServerCnxn.java   
@Override
public void commandRun() {
    if (zkServer == null) {
        pw.print("null");
    } else if (zkServer instanceof ReadOnlyZooKeeperServer) {
        pw.print("ro");
    } else {
        pw.print("rw");
    }
}
项目:zookeeper    文件:NettyServerCnxn.java   
@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());
    }

}
项目:zookeeper    文件:NettyServerCnxn.java   
@Override
public void commandRun() {
    if (zkServer == null) {
        pw.print("null");
    } else if (zkServer instanceof ReadOnlyZooKeeperServer) {
        pw.print("ro");
    } else {
        pw.print("rw");
    }
}
项目:zookeeper    文件:NIOServerCnxn.java   
@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());
    }

}
项目:zookeeper    文件:NIOServerCnxn.java   
@Override
public void commandRun() {
    if (zkServer == null) {
        pw.print("null");
    } else if (zkServer instanceof ReadOnlyZooKeeperServer) {
        pw.print("ro");
    } else {
        pw.print("rw");
    }
}
项目:SecureKeeper    文件:Commands.java   
@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;

}
项目:SecureKeeper    文件:IsroCommand.java   
@Override
public void commandRun() {
    if (zkServer == null) {
        pw.print("null");
    } else if (zkServer instanceof ReadOnlyZooKeeperServer) {
        pw.print("ro");
    } else {
        pw.print("rw");
    }
}
项目:SecureKeeper    文件:Commands.java   
@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;

}
项目:SecureKeeper    文件:IsroCommand.java   
@Override
public void commandRun() {
    if (zkServer == null) {
        pw.print("null");
    } else if (zkServer instanceof ReadOnlyZooKeeperServer) {
        pw.print("ro");
    } else {
        pw.print("rw");
    }
}
项目:StreamBench    文件:NettyServerCnxn.java   
@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());
    }

}
项目:StreamBench    文件:NettyServerCnxn.java   
@Override
public void commandRun() {
    if (zkServer == null) {
        pw.print("null");
    } else if (zkServer instanceof ReadOnlyZooKeeperServer) {
        pw.print("ro");
    } else {
        pw.print("rw");
    }
}
项目:StreamBench    文件:NIOServerCnxn.java   
@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());
    }

}