LayoutRecommendationInfo getLayoutRecommendationInfo(AddServiceInfo info) {
    if (info.getRecommendationInfo().isPresent()) {
      return info.getRecommendationInfo().get();
    }
    try {
      Map<String, Map<String, Set<String>>> allServices = getAllServices(info);
      Map<String, Set<String>> hostGroups =
        getHostGroupStrategy().calculateHostGroups(getHostComponentMap(getComponentHostMap(allServices)));
      return new LayoutRecommendationInfo(hostGroups, allServices);
    }
    catch (AmbariException ex) {
      throw new IllegalArgumentException("Error gathering host groups and services", ex);
    }
  }
Reuse information from layout recommendation if it happened
ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/StackAdvisorAdapter.java