private Map<String, Map<String, String>> addAdditionalConfigurations(Cluster cluster, Map<String, Map<String, String>> configurations,
                                                                       String hostname, Map<String, String> kerberosDescriptorProperties,
                                                                       @Nullable KerberosDescriptor userDescriptor,
                                                                       Map<String, String> componentHosts,
                                                                       @Nullable Map<String, DesiredConfig> desiredConfigs
  )
    throws AmbariException {

    // A map to hold un-categorized properties.  This may come from the KerberosDescriptor
    // and will also contain a value for the current host
    Map<String, String> generalProperties = configurations.computeIfAbsent("", k -> new HashMap<>());

    // If any properties are set in the calculated KerberosDescriptor, add them into the
    // Map of configurations as an un-categorized type (using an empty string)
    if (kerberosDescriptorProperties != null) {
      generalProperties.putAll(kerberosDescriptorProperties);
    }

    if (!StringUtils.isEmpty(hostname)) {
      // Add the current hostname under "host" and "hostname"
      generalProperties.put("host", hostname);
      generalProperties.put("hostname", hostname);
    }

    // Add the current cluster's name
    generalProperties.put("cluster_name", cluster.getClusterName());

    // Add the current date in short format (MMddyy)
    generalProperties.put("short_date", new SimpleDateFormat("MMddyy").format(new Date()));

    // add clusterHostInfo config
    if (configurations.get(CLUSTER_HOST_INFO) == null) {
      if (componentHosts == null) {
        componentHosts = new HashMap<>();
      }
      if (componentHosts.isEmpty()) {
        Map<String, Set<String>> clusterHostInfo = StageUtils.getClusterHostInfo(cluster);
        if (clusterHostInfo != null) {

          clusterHostInfo = StageUtils.substituteHostIndexes(clusterHostInfo);

          for (Map.Entry<String, Set<String>> entry : clusterHostInfo.entrySet()) {
            componentHosts.put(entry.getKey(), StringUtils.join(entry.getValue(), ","));
          }
        }
      }
      if (!componentHosts.isEmpty()) {
        configurations.put(CLUSTER_HOST_INFO, componentHosts);
      }
    }
    configurations.put("principals", principalNames(cluster, configurations, userDescriptor, desiredConfigs));
    return configurations;
  }
Add configurations related to Kerberos, to a previously created map of configurations.
<p/>
The supplied map of configurations is expected to be mutable and will be altered.

@param cluster                      the cluster
@param configurations               a map of configurations
@param hostname                     a hostname
@param kerberosDescriptorProperties the Kerberos descriptor properties
@return the supplied map of configurations with updates applied
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java