void requestResource(ContainerAllocator containerAllocator, String containerID, String preferredHost, Duration preferredHostRetryDelay, String hostToAvoid) {
    if (StandbyTaskUtil.isStandbyContainer(containerID) && isFaultDomainAwareStandbyEnabled) {
      containerAllocator.requestResourceWithDelay(containerID, preferredHost, preferredHostRetryDelay, getAllowedFaultDomainsGivenHostToAvoid(hostToAvoid));
    } else {
      containerAllocator.requestResourceWithDelay(containerID, preferredHost, preferredHostRetryDelay, new HashSet<>());
    }
  }
This method checks from the config if standby allocation is fault domain aware or not, and requests resources accordingly.

@param containerAllocator ContainerAllocator object that requests for resources from the resource manager
@param containerID Samza container ID that will be run when a resource is allocated for this request
@param preferredHost name of the host that you prefer to run the processor on
@param preferredHostRetryDelay the {@link Duration} to add to the request timestamp
@param hostToAvoid The hostname to avoid requesting this resource on if fault domain aware standby allocation is enabled
samza-core/src/main/java/org/apache/samza/clustermanager/StandbyContainerManager.java