public static Configuration parseConfigs(@Nullable Collection<? extends Map<String, ?>> configs) {
    Configuration configuration;

    if (null == configs || configs.isEmpty()) {
      configuration = Configuration.newEmpty();
    }
    else if (configs.iterator().next().keySet().iterator().next().contains("/")) {
      // Configuration has keys with slashes like "zk.cfg/properties/dataDir" means it is coming through
      // the resource framework and must be parsed with configuration factories
      checkFlattenedConfig(configs);
      configuration = new ConfigurationFactory().getConfiguration((Collection<Map<String, String>>)configs);
    }
    else {
      // If the configuration does not have keys with slashes it means it is coming from plain JSON and needs to be
      // parsed accordingly.
      Map<String, Map<String, String>> allProperties = new HashMap<>();
      Map<String, Map<String, Map<String, String>>> allAttributes = new HashMap<>();
      configs.forEach( item -> {

        checkArgument(item.size() == 1, "Each config object must have a single property which is the name of the config," +
          " e.g. \"cluster-env\" : {...}");

        Map.Entry<String, ?> configEntry = item.entrySet().iterator().next();
        String configName = item.keySet().iterator().next();

        checkArgument(configEntry.getValue() instanceof Map,
          "The value for %s must be a JSON object (found: %s)", configName, getClassName(configEntry.getValue()));

        Map<String, ?> configData = (Map<String, ?>) configEntry.getValue();

        Set<String> extraKeys = Sets.difference(configData.keySet(), PERMITTED_CONFIG_FIELDS);
        boolean legacy = extraKeys.size() == configData.keySet().size();
        checkArgument(legacy || extraKeys.isEmpty(), "Invalid fields in %s configuration: %s", configName, extraKeys);

        if (legacy) {
          checkMap("don't care", configData, String.class);
          Map<String, String> properties = (Map<String, String>)configData;
          allProperties.put(configName, properties);
        } else {
          if (configData.containsKey(PROPERTIES_PROPERTY_ID)) {
            checkMap(PROPERTIES_PROPERTY_ID, configData.get(PROPERTIES_PROPERTY_ID), String.class);

            Map<String, String> properties = (Map<String, String>) configData.get(PROPERTIES_PROPERTY_ID);
            allProperties.put(configName, properties);
          }
          if (configData.containsKey(PROPERTIES_ATTRIBUTES_PROPERTY_ID)) {
            checkMap(PROPERTIES_ATTRIBUTES_PROPERTY_ID, configData.get(PROPERTIES_ATTRIBUTES_PROPERTY_ID), Map.class);
            Map<String, Map<String, String>> attributes =
              (Map<String, Map<String, String>>) configData.get(PROPERTIES_ATTRIBUTES_PROPERTY_ID);
            attributes.forEach((key, value) -> checkMap(key, value, String.class));

            allAttributes.put(configName, attributes);
          }
        }
      });

      configuration = new Configuration(allProperties, allAttributes);
    }
    return configuration;
  }
Parses configuration maps The configs can be in fully structured JSON, e.g.
<code>
[{"hdfs-site":
 "properties": {
   ""dfs.replication": "3",
   ...
 },
 properties_attributes: {}
}]
</code>
or flattened like
<code>
[{
 "hdfs-site/properties/dfs.replication": "3",
 ...
}]
</code>
In the latter case it calls {@link ConfigurationFactory#getConfiguration(Collection)}
ambari-server/src/main/java/org/apache/ambari/server/topology/ConfigurableHelper.java