private List<HostsType.HighAvailabilityHosts> nameSpaces(Set<String> componentHosts) {
    return NameService.fromConfig(m_configHelper, getCluster()).stream()
      .map(each -> findMasterAndSecondaries(each, componentHosts))
      .collect(Collectors.toList());

  }
Get the NameNode NameSpaces (master->secondaries hosts).
In each NameSpace there should be exactly 1 master and at least one secondary host.
ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java