public static NameNode fromConfig(String nameServiceId, String nnUniqueId, ConfigHelper config, Cluster cluster) {
      String namenodeFragment = "dfs.namenode." + (isEncrypted(config, cluster) ? "https-address" : "http-address") + ".{0}.{1}";
      String propertyName = MessageFormat.format(namenodeFragment, nameServiceId, nnUniqueId);
      return new NameNode(
        nnUniqueId,
        config.getValueFromDesiredConfigurations(cluster, ConfigHelper.HDFS_SITE, propertyName),
        isEncrypted(config, cluster),
        propertyName);
    }
I represent a nameServiceId that belongs to HDFS. Multiple namenodes may belong to the same nameServiceId.
Each NameNode has either an http or https address.
ambari-server/src/main/java/org/apache/ambari/server/stack/NameService.java