void persistServiceComponentHosts(Set<ServiceComponentHostRequest> requests, boolean isBlueprintProvisioned)
    throws AmbariException {
    Multimap<Cluster, ServiceComponentHost> schMap = ArrayListMultimap.create();
    Map<Long, Map<String, List<String>>> serviceComponentNames = new HashMap<>();
    Map<Long, Map<String, Map<String, ServiceComponentDesiredStateEntity>>> serviceComponentDesiredStateEntities = new HashMap<>();

    for (ServiceComponentHostRequest request : requests) {
      Cluster cluster = clusters.getCluster(request.getClusterName());
      Service s = cluster.getService(request.getServiceName());
      ServiceComponent sc = s.getServiceComponent(
          request.getComponentName());
      serviceComponentNames.computeIfAbsent(sc.getClusterId(), c -> new HashMap<>())
          .computeIfAbsent(sc.getServiceName(), h ->new ArrayList<>()).add(sc.getName());
    }

    List<ServiceComponentDesiredStateEntity> entities = serviceComponentDesiredStateDAO.findByNames(serviceComponentNames);

    for (ServiceComponentDesiredStateEntity stateEntity : entities) {
      serviceComponentDesiredStateEntities.computeIfAbsent(stateEntity.getClusterId(), c -> new HashMap<>())
          .computeIfAbsent(stateEntity.getServiceName(), h ->new HashMap<>())
          .putIfAbsent(stateEntity.getComponentName(), stateEntity);
    }

    for (ServiceComponentHostRequest request : requests) {
      Cluster cluster = clusters.getCluster(request.getClusterName());
      Service s = cluster.getService(request.getServiceName());
      ServiceComponent sc = s.getServiceComponent(
          request.getComponentName());

      ServiceComponentHost sch =
          serviceComponentHostFactory.createNew(sc, request.getHostname(),
              serviceComponentDesiredStateEntities.get(cluster.getClusterId()).get(s.getName()).get(sc.getName()));
      if (request.getDesiredState() != null
          && !request.getDesiredState().isEmpty()) {
        State state = State.valueOf(request.getDesiredState());
        sch.setDesiredState(state);
      }
      if (isBlueprintProvisioned && !sch.isClientComponent()) {
        HostComponentDesiredStateEntity desiredStateEntity = sch.getDesiredStateEntity();
        desiredStateEntity.setBlueprintProvisioningState(BlueprintProvisioningState.IN_PROGRESS);
        hostComponentDesiredStateDAO.merge(desiredStateEntity);
      }

      schMap.put(cluster, sch);
    }

    for (Cluster cluster : schMap.keySet()) {
      cluster.addServiceComponentHosts(schMap.get(cluster));
    }
  }
For all components that will be added validate the exclusive components dependencies using the services metainfo
and respecting already installed components

@throws AmbariException is thrown if the exclusive dependency is violated or if the data is invalid
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java