private Map<String, Set<String>> createServiceComponentMap(Blueprint blueprint) {
    Map<String, Set<String>> serviceComponents = new HashMap<>();
    Collection<String> services = blueprint.getServices();

    if(services != null) {
      for (String service : services) {
        Collection<String> components = blueprint.getComponents(service);
        Set<String> componentSet = components == null ? ImmutableSet.of() : ImmutableSet.copyOf(components);
        serviceComponents.put(service, componentSet);
      }
    }

    return serviceComponents;
  }
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