private Collection<String> getRequiredHostgroupsForKerberosConfiguration() {
    Collection<String> requiredHostGroups = new HashSet<>();

    try {
      Cluster cluster = getCluster();
      Blueprint blueprint = clusterTopology.getBlueprint();

      Configuration clusterConfiguration = clusterTopology.getConfiguration();
      Map<String, Map<String, String>> existingConfigurations = clusterConfiguration.getFullProperties();
      existingConfigurations.put(KerberosHelper.CLUSTER_HOST_INFO, new HashMap<>());

      // apply Kerberos specific configurations
      Map<String, Map<String, String>> updatedConfigs = AmbariContext.getController().getKerberosHelper()
        .getServiceConfigurationUpdates(cluster, existingConfigurations,
          createServiceComponentMap(blueprint), null, null, true, false);

      // retrieve hostgroup for component names extracted from variables like "{clusterHostInfo.(component_name)
      // _host}"
      for (String configType : updatedConfigs.keySet()) {
        Map<String, String> propertyMap = updatedConfigs.get(configType);
        for (String property : propertyMap.keySet()) {
          String propertyValue = propertyMap.get(property);
          Matcher matcher = CLUSTER_HOST_INFO_PATTERN_VARIABLE.matcher(propertyValue);
          while (matcher.find()) {
            String component = matcher.group(1).toUpperCase();
            Collection<String> hostGroups = clusterTopology.getHostGroupsForComponent(component);
            if (hostGroups.isEmpty()) {
              LOG.warn("No matching hostgroup found for component: {} specified in Kerberos config type: {} property:" +
                " " +
                "{}", component, configType, property);
            } else {
              requiredHostGroups.addAll(hostGroups);
            }
          }
        }
      }

    } catch (KerberosInvalidConfigurationException | AmbariException e) {
      LOG.error("An exception occurred while doing Kerberos related configuration update: " + e, e);
    }
    return requiredHostGroups;
  }
Create a map of services and the relevant components that are specified in the Blueprint

@param blueprint the blueprint
@return a map of service names to component names
ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterConfigurationRequest.java