@SuppressWarnings("unchecked")
  private Map<String, Set<String>> calculateComponentHostsMap(Cluster cluster) {
    /*
     * ClassCastException may occur in case of body inconsistency: property
     * missed, etc.
     */

    Map<String, Set<String>> componentHostsMap = new HashMap<>();
    List<ServiceComponentHost> schs = cluster.getServiceComponentHosts();
    for (ServiceComponentHost sch : schs) {
      componentHostsMap.putIfAbsent(sch.getServiceComponentName(), new HashSet<>());
      componentHostsMap.get(sch.getServiceComponentName()).add(sch.getHostName());
    }

    return componentHostsMap;
  }
Parse the user contex for the call. Typical structure
{ "operation" : "createCluster" }
{ "operation" : "addService", "services" : "Atlas,Ranger" }
@param request
@return
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackAdvisorResourceProvider.java