public static List<String> getStandbyContainerConstraints(String containerID, JobModel jobModel) {

    ContainerModel givenContainerModel = jobModel.getContainers().get(containerID);
    List<String> containerIDsWithStandbyConstraints = new ArrayList<>();

    // iterate over all containerModels in the jobModel
    for (ContainerModel containerModel : jobModel.getContainers().values()) {

      // add to list if active and standby tasks on the two containerModels overlap
      if (!givenContainerModel.equals(containerModel) && checkTaskOverlap(givenContainerModel, containerModel)) {
        containerIDsWithStandbyConstraints.add(containerModel.getId());
      }
    }
    return containerIDsWithStandbyConstraints;
  }
Given a containerID and job model, it returns the containerids of all containers that either have
 a. standby tasks corresponding to active tasks on the given container, or
 b. have active tasks corresponding to standby tasks on the given container.
 This is used to ensure that an active task and all its corresponding standby tasks are on separate hosts, and
 standby tasks corresponding to the same active task are on separate hosts.
samza-core/src/main/java/org/apache/samza/clustermanager/StandbyTaskUtil.java