Map<String, List<String>> getNameServicesToNameNodes(Map<String, String> hdfsSite) throws InvalidTopologyException {
    String nameServices = null != hdfsSite.get("dfs.internal.nameservices") ?
      hdfsSite.get("dfs.internal.nameservices") : hdfsSite.get("dfs.nameservices");
    Map<String, List<String>> nameServicesToNameNodes = new HashMap<>();

    for (String ns: SPLITTER.splitToList(nameServices)) {
      String nameNodes = hdfsSite.get("dfs.ha.namenodes." + ns);
      checkInvalidTopology(Strings.isNullOrEmpty(nameNodes),
        "No namenodes specified for nameservice %s.", ns);
      nameServicesToNameNodes.put(ns, SPLITTER.splitToList(nameNodes));
    }

    return nameServicesToNameNodes;
  }
Verifies that all respective properties are set for an external NANENODE HA setup
ambari-server/src/main/java/org/apache/ambari/server/topology/validators/NameNodeHaValidator.java