@Override
  public RefreshServiceAclsResponse refreshServiceAcls(RefreshServiceAclsRequest request)
      throws YarnException, IOException {

    // parameter verification.
    if (request == null) {
      routerMetrics.incrRefreshServiceAclsFailedRetrieved();
      RouterServerUtil.logAndThrowException("Missing RefreshServiceAcls request.", null);
    }

    // call refreshAdminAcls of activeSubClusters.
    try {
      long startTime = clock.getTime();
      RMAdminProtocolMethod remoteMethod = new RMAdminProtocolMethod(
          new Class[]{RefreshServiceAclsRequest.class}, new Object[]{request});
      String subClusterId = request.getSubClusterId();
      Collection<RefreshServiceAclsResponse> refreshServiceAclsResps =
          remoteMethod.invokeConcurrent(this, RefreshServiceAclsResponse.class, subClusterId);
      if (CollectionUtils.isNotEmpty(refreshServiceAclsResps)) {
        long stopTime = clock.getTime();
        routerMetrics.succeededRefreshServiceAclsRetrieved(stopTime - startTime);
        return RefreshServiceAclsResponse.newInstance();
      }
    } catch (YarnException e) {
      routerMetrics.incrRefreshServiceAclsFailedRetrieved();
      RouterServerUtil.logAndThrowException(e,
          "Unable to refreshAdminAcls due to exception. " + e.getMessage());
    }

    routerMetrics.incrRefreshServiceAclsFailedRetrieved();
    throw new YarnException("Unable to refreshServiceAcls.");
  }
@Test
  public void testSC1RefreshServiceAcls() throws Exception {
    // case 1, test the existing subCluster (SC-1).
    String existSubCluster = "SC-1";
    RefreshServiceAclsRequest request = RefreshServiceAclsRequest.newInstance(existSubCluster);
    RefreshServiceAclsResponse response = interceptor.refreshServiceAcls(request);
    assertNotNull(response);

    // case 2, test the non-exist subCluster.
    String notExistsSubCluster = "SC-NON";
    RefreshServiceAclsRequest request1 = RefreshServiceAclsRequest.newInstance(notExistsSubCluster);
    LambdaTestUtils.intercept(Exception.class, "subClusterId = SC-NON is not an active subCluster.",
        () -> interceptor.refreshServiceAcls(request1));
  }