protected Set<HostResponse> getHosts(Set<HostRequest> requests) throws AmbariException {
    Set<HostResponse> response = new HashSet<>();

    AmbariManagementController controller = getManagementController();

    for (HostRequest request : requests) {
      try {
        response.addAll(getHosts(controller, request, osFamily));
      } catch (HostNotFoundException e) {
        if (requests.size() == 1) {
          // only throw exception if 1 request.
          // there will be > 1 request in case of OR predicate
          throw e;
        }
      }
    }
    return response;
  }
If the rack info provided in the request differs from the rack info of the host
update the rack info of the host with the value from the host request

@param cluster The cluster to check user privileges against. User is required
               to have {@link RoleAuthorization#HOST_ADD_DELETE_HOSTS} rights on the cluster.
@param host The host of which rack information is to be updated
@param hostRequest
@return true is host was updated otherwise false
@throws AmbariException
@throws AuthorizationException
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java