public static Set<ServerName> parseMasterAddrs(Configuration conf) throws UnknownHostException {
    final int defaultPort = getDefaultMasterPort(conf);
    final Set<ServerName> masterAddrs = new HashSet<>();
    final String configuredMasters = getMasterAddr(conf);
    for (String masterAddr : Splitter.onPattern(MASTER_ADDRS_CONF_SEPARATOR)
      .split(configuredMasters)) {
      final HostAndPort masterHostPort =
        HostAndPort.fromString(masterAddr.trim()).withDefaultPort(defaultPort);
      masterAddrs.add(ServerName.valueOf(masterHostPort.toString(), ServerName.NON_STARTCODE));
    }
    Preconditions.checkArgument(!masterAddrs.isEmpty(), "At least one master address is needed");
    return masterAddrs;
  }
Parses the list of master addresses from the provided configuration. Supported format is comma
separated host[:port] values. If no port number if specified, default master port is assumed.
@param conf Configuration to parse from.
hbase-client/src/main/java/org/apache/hadoop/hbase/client/MasterRegistry.java