private void updateHostRackInfoIfChanged(Clusters clusters, Set<HostRequest> hostRequests)
    throws AmbariException, AuthorizationException {

    HashSet<String> rackChangeAffectedClusters = new HashSet<>();

    for (HostRequest hostRequest : hostRequests) {
      String clusterName = hostRequest.getClusterName();

      if (StringUtils.isNotBlank(clusterName)) {
        Cluster cluster = clusters.getCluster(clusterName);
        Host host = clusters.getHost(hostRequest.getHostname());

        if (updateHostRackInfoIfChanged(cluster, host, hostRequest))
          rackChangeAffectedClusters.add(clusterName);
      }
    }
    // TODO rack change topology update
    for (String clusterName: rackChangeAffectedClusters) {
      getManagementController().registerRackChange(clusterName);
    }
  }
Iterates through the provided host request and checks if there is rack info provided.
If the rack info differs from the rack info of the host than updates it with the value from
the host request.
@param clusters
@param hostRequests
@throws AmbariException
@throws AuthorizationException
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java