public Set<FaultDomain> getAllowedFaultDomainsGivenHostToAvoid(String hostToAvoid) {
    Set<FaultDomain> allFaultDomains = faultDomainManager.getAllFaultDomains();
    Set<FaultDomain> faultDomainToAvoid = Optional.ofNullable(hostToAvoid)
            .map(faultDomainManager::getFaultDomainsForHost)
            .orElse(Collections.emptySet());
    allFaultDomains.removeAll(faultDomainToAvoid);
    return allFaultDomains;
  }
This method removes the fault domain of the host passed as an argument, from the set of fault domains, and then returns it.
The set of fault domains returned is based on the set difference between all the available fault domains in the
cluster and the fault domain associated with the host that is passed as input.
@param hostToAvoid hostname whose fault domains are excluded
@return The set of fault domains which excludes the fault domain that the given host is on
samza-core/src/main/java/org/apache/samza/clustermanager/StandbyContainerManager.java