Class ZKDump

java.lang.Object
org.apache.hadoop.hbase.zookeeper.ZKDump

@Private public final class ZKDump extends Object
Builds a string containing everything in ZooKeeper. This is inherently invasive into the structures of other components' logical responsibilities.
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
  • Constructor Details

  • Method Details

    • dump

      public static String dump(ZKWatcher zkWatcher)
    • getReplicationZnodesDump

      private static void getReplicationZnodesDump(ZKWatcher zkw, StringBuilder sb) throws org.apache.zookeeper.KeeperException
      Appends replication znodes to the passed StringBuilder.
      Parameters:
      zkw - reference to the ZKWatcher which also contains configuration and operation
      sb - the StringBuilder to append to
      Throws:
      org.apache.zookeeper.KeeperException - if a ZooKeeper operation fails
    • appendHFileRefsZNodes

      private static void appendHFileRefsZNodes(ZKWatcher zkw, String hFileRefsZNode, StringBuilder sb) throws org.apache.zookeeper.KeeperException
      Throws:
      org.apache.zookeeper.KeeperException
    • getReplicationZnodesDump

      public static String getReplicationZnodesDump(ZKWatcher zkw) throws org.apache.zookeeper.KeeperException
      Returns a string with replication znodes and position of the replication log
      Parameters:
      zkw - reference to the ZKWatcher which also contains configuration and operation
      Returns:
      aq string of replication znodes and log positions
      Throws:
      org.apache.zookeeper.KeeperException
    • appendRSZnodes

      private static void appendRSZnodes(ZKWatcher zkw, String znode, StringBuilder sb) throws org.apache.zookeeper.KeeperException
      Throws:
      org.apache.zookeeper.KeeperException
    • appendPeersZnodes

      private static void appendPeersZnodes(ZKWatcher zkw, String peersZnode, StringBuilder sb) throws org.apache.zookeeper.KeeperException
      Throws:
      org.apache.zookeeper.KeeperException
    • appendPeerState

      private static void appendPeerState(ZKWatcher zkw, String znodeToProcess, StringBuilder sb) throws org.apache.zookeeper.KeeperException, org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferException
      Throws:
      org.apache.zookeeper.KeeperException
      org.apache.hbase.thirdparty.com.google.protobuf.InvalidProtocolBufferException
    • getServerStats

      private static String[] getServerStats(String server, int timeout) throws IOException
      Gets the statistics from the given server.
      Parameters:
      server - The server to get the statistics from.
      timeout - The socket timeout to use.
      Returns:
      The array of response strings.
      Throws:
      IOException - When the socket communication fails.