Search in sources :

Example 1 with ServerCnxn

use of org.apache.zookeeper_voltpatches.server.ServerCnxn in project voltdb by VoltDB.

the class WatchManager method dumpWatches.

/**
     * String representation of watches. Warning, may be large!
     * @param byPath iff true output watches by paths, otw output
     * watches by connection
     * @return string representation of watches
     */
public synchronized void dumpWatches(PrintWriter pwriter, boolean byPath) {
    if (byPath) {
        for (Entry<String, HashSet<Watcher>> e : watchTable.entrySet()) {
            pwriter.println(e.getKey());
            for (Watcher w : e.getValue()) {
                pwriter.print("\t0x");
                pwriter.print(Long.toHexString(((ServerCnxn) w).getSessionId()));
                pwriter.print("\n");
            }
        }
    } else {
        for (Entry<Watcher, HashSet<String>> e : watch2Paths.entrySet()) {
            pwriter.print("0x");
            pwriter.println(Long.toHexString(((ServerCnxn) e.getKey()).getSessionId()));
            for (String path : e.getValue()) {
                pwriter.print("\t");
                pwriter.println(path);
            }
        }
    }
}
Also used : ServerCnxn(org.apache.zookeeper_voltpatches.server.ServerCnxn) Watcher(org.apache.zookeeper_voltpatches.Watcher) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 Watcher (org.apache.zookeeper_voltpatches.Watcher)1 ServerCnxn (org.apache.zookeeper_voltpatches.server.ServerCnxn)1