private Map<String, Collection<DependencyInfo>> validateHostGroup(HostGroup group, String dependencyValidationType) {
    LOGGER.info("Validating hostgroup: {}", group.getName());
    Map<String, Collection<DependencyInfo>> dependenciesIssues = new HashMap<>();

    for (String component : new HashSet<>(group.getComponentNames())) {
      LOGGER.debug("Processing component: {}", component);

      for (DependencyInfo dependency : stack.getDependenciesForComponent(component)) {
        LOGGER.debug("Processing dependency [{}] for component [{}]", dependency.getName(), component);

        String conditionalService = stack.getConditionalServiceForDependency(dependency);
        if (conditionalService != null && !blueprint.getServices().contains(conditionalService)) {
          LOGGER.debug("Conditional service  [{}] is missing from the blueprint, skipping dependency [{}]",
              conditionalService, dependency.getName());
          continue;
        }

        // dependent components from the stack definitions are only added if related services are explicitly added to the blueprint!
        ComponentInfo dependencyComponent = stack.getComponentInfo(dependency.getComponentName());
        if (dependencyComponent == null) {
          LOGGER.debug("The component [{}] is not associated with any known services, skipping dependency", dependency.getComponentName());
          continue;
        }

        boolean isClientDependency = dependencyComponent.isClient();
        if (isClientDependency && !blueprint.getServices().contains(dependency.getServiceName())) {
          LOGGER.debug("The service [{}] for component [{}] is missing from the blueprint [{}], skipping dependency",
              dependency.getServiceName(), dependency.getComponentName(), blueprint.getName());
          continue;
        }

        String         dependencyScope = dependency.getScope();
        String         dependencyType  = dependency.getType();
        String         componentName   = dependency.getComponentName();
        AutoDeployInfo autoDeployInfo  = dependency.getAutoDeploy();
        boolean        resolved        = false;

        if (dependencyValidationType != null && !dependencyValidationType.equals(dependencyType)) {
          continue;
        }

        //check if conditions are met, if any
        if(dependency.hasDependencyConditions()) {
          boolean conditionsSatisfied = true;
          for (DependencyConditionInfo dependencyCondition : dependency.getDependencyConditions()) {
            if (!dependencyCondition.isResolved(blueprint.getConfiguration().getFullProperties())) {
              conditionsSatisfied = false;
              break;
            }
          }
          if(!conditionsSatisfied){
            continue;
          }
        }
        if (dependencyScope.equals("cluster")) {
          Collection<String> missingDependencyInfo = verifyComponentCardinalityCount(
              componentName, new Cardinality("1+"), autoDeployInfo);

          resolved = missingDependencyInfo.isEmpty();
          if (dependencyType.equals("exclusive")) {
            resolved = !resolved;
          }
        } else if (dependencyScope.equals("host")) {
          if (dependencyType.equals("exclusive")) {
            if (!group.getComponentNames().contains(componentName)) {
              resolved = true;
            }
          } else {
            if (group.getComponentNames().contains(componentName) || (autoDeployInfo != null && autoDeployInfo.isEnabled())) {
              resolved = true;
              group.addComponent(componentName);
            }
          }
        }

        if (! resolved) {
          Collection<DependencyInfo> compDependenciesIssues = dependenciesIssues.get(component);
          if (compDependenciesIssues == null) {
            compDependenciesIssues = new HashSet<>();
            dependenciesIssues.put(component, compDependenciesIssues);
          }
          compDependenciesIssues.add(dependency);
        }
      }
    }
    return dependenciesIssues;
  }
Verify that a component is included in all host groups.
For components that are auto-install enabled, will add component to topology if needed.

@param component   component to validate
@param autoDeploy  auto-deploy information for component

@return collection of missing component information
ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintValidatorImpl.java