private void addAdvisedConfigurationsToTopology(RecommendationResponse response,
                                                  ClusterTopology topology, Map<String, Map<String, String>> userProvidedConfigurations) {
    Preconditions.checkArgument(response.getRecommendations() != null,
      "Recommendation response is empty.");
    Preconditions.checkArgument(response.getRecommendations().getBlueprint() != null,
      "Blueprint field is missing from the recommendation response.");
    Preconditions.checkArgument(response.getRecommendations().getBlueprint().getConfigurations() != null,
      "Configurations are missing from the recommendation blueprint response.");

    Map<String, BlueprintConfigurations> recommendedConfigurations =
      response.getRecommendations().getBlueprint().getConfigurations();
    Blueprint blueprint = topology.getBlueprint();

    for (Map.Entry<String, BlueprintConfigurations> configEntry : recommendedConfigurations.entrySet()) {
      String configType = configEntry.getKey();
      // add recommended config type only if related service is present in Blueprint
      if (blueprint.isValidConfigType(configType)) {
        BlueprintConfigurations blueprintConfig = filterBlueprintConfig(configType, configEntry.getValue(),
                userProvidedConfigurations, topology);
        topology.getAdvisedConfigurations().put(configType, new AdvisedConfiguration(
                blueprintConfig.getProperties(), blueprintConfig.getPropertyAttributes()));
      }
    }
  }
Recommend configurations by the stack advisor, then store the results in cluster topology.
@param clusterTopology cluster topology instance
@param userProvidedConfigurations User configurations of cluster provided in Blueprint + Cluster template
ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java