@Override
  public Set<FaultDomain> getFaultDomainsForHost(String host) {
    if (!hostToRackMap.containsKey(host)) {
      hostToRackMap = computeHostToFaultDomainMap();
      hostToFaultDomainCacheUpdates.inc();
    }
    return new HashSet<>(hostToRackMap.get(host));
  }
This method returns the rack a particular host resides on based on the internal cache.
In case the rack of a host does not exist in this cache, we update the cache by computing the host to rack map again using Yarn.
@param host the host
@return the {@link FaultDomain}
samza-yarn3/src/main/java/org/apache/samza/job/yarn/YarnFaultDomainManager.java