class HomeAMRMProxyPolicy extends AbstractAMRMProxyPolicy {

  @Override
  public Map<SubClusterId, List<ResourceRequest>> splitResourceRequests(
      List<ResourceRequest> resourceRequests) throws YarnException {

    if (homeSubcluster == null) {
      throw new FederationPolicyException("No home subcluster available");
    }

    Map<SubClusterId, SubClusterInfo> active = getActiveSubclusters();
    if (!active.containsKey(homeSubcluster)) {
      throw new FederationPolicyException(
          "The local subcluster " + homeSubcluster + " is not active");
    }

    List<ResourceRequest> resourceRequestsCopy =
        new ArrayList<>(resourceRequests);
    return Collections.singletonMap(homeSubcluster, resourceRequestsCopy);
  }

}