private Collection<String> verifyComponentInAllHostGroups(String component, AutoDeployInfo autoDeploy) {

    Collection<String> cardinalityFailures = new HashSet<>();
    int actualCount = blueprint.getHostGroupsForComponent(component).size();
    Map<String, HostGroup> hostGroups = blueprint.getHostGroups();
    if (actualCount != hostGroups.size()) {
      if (autoDeploy != null && autoDeploy.isEnabled()) {
        for (HostGroup group : hostGroups.values()) {
          group.addComponent(component);
        }
      } else {
        cardinalityFailures.add(component + "(actual=" + actualCount + ", required=ALL)");
      }
    }
    return cardinalityFailures;
  }
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