public static int getMasterInfoPort(final ZKWatcher zkw) throws KeeperException, IOException {
    byte[] data;
    try {
      data = ZKUtil.getData(zkw, zkw.getZNodePaths().masterAddressZNode);
    } catch (InterruptedException e) {
      throw new InterruptedIOException();
    }
    // TODO javadoc claims we return null in this case. :/
    if (data == null) {
      throw new IOException("Can't get master address from ZooKeeper; znode data == null");
    }
    try {
      return parse(data).getInfoPort();
    } catch (DeserializationException e) {
      KeeperException ke = new KeeperException.DataInconsistencyException();
      ke.initCause(e);
      throw ke;
    }
  }
Get master info port. Use this instead of {@link #getMasterInfoPort()} if you do not have an
instance of this tracker in your context.
@param zkw ZKWatcher to use
@return master info port in the the master address znode or null if no znode present. // TODO
        can't return null for 'int' return type. non-static verison returns 0
@throws KeeperException if a ZooKeeper operation fails
@throws IOException     if the address of the ZooKeeper master cannot be retrieved
hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/MasterAddressTracker.java