private static Set<String> getHostsForServiceComponent(Cluster cluster, String service, String component) {
    try {
      return cluster.getService(service).getServiceComponent(component).getServiceComponentsHosts();
    } catch (AmbariException e) {
      return CHECK.wrapInUnchecked(e, IllegalStateException::new, "Error getting hosts for service %s component %: %s", service, component, e, e);
    }
  }
Creates the service, component and host component resources for the request.
ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/AddServiceOrchestrator.java