public static String parseMasterServerName(String rsZnodePath) {
    String masterServerName = null;
    try {
      String[] rsZnodeParts = rsZnodePath.split("/");
      masterServerName = rsZnodeParts[rsZnodeParts.length - 1];
    } catch (IndexOutOfBoundsException e) {
      LOG.warn("String " + rsZnodePath + " has wrong format", e);
    }
    return masterServerName;
  }
See HBASE-14861. We are extracting master ServerName from rsZnodePath example:
"/hbase/rs/server.example.com,16020,1448266496481"
@param rsZnodePath from HBASE_ZNODE_FILE
@return String representation of ServerName or null if fails
hbase-server/src/main/java/org/apache/hadoop/hbase/ZNodeClearer.java