@Override
  public Map<SubClusterId, List<ResourceRequest>> splitResourceRequests(
      List<ResourceRequest> resourceRequests,
      Set<SubClusterId> timedOutSubClusters) 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);
  }
@Test
  public void testSplitAllocateRequest() throws YarnException {

    // Verify the request only goes to the home subcluster
    String[] hosts = new String[] {"host0", "host1", "host2", "host3"};
    List<ResourceRequest> resourceRequests = createResourceRequests(
        hosts, 2 * 1024, 2, 1, 3, null, false);

    HomeAMRMProxyPolicy federationPolicy =
        (HomeAMRMProxyPolicy) getPolicy();
    Map<SubClusterId, List<ResourceRequest>> response = federationPolicy
        .splitResourceRequests(resourceRequests, new HashSet<SubClusterId>());
    assertEquals(1, response.size());
    assertNotNull(response.get(HOME_SC_ID));
    assertEquals(9, response.get(HOME_SC_ID).size());
  }