@Override
  public GetAllResourceTypeInfoResponse getResourceTypeInfo(
      GetAllResourceTypeInfoRequest request) throws YarnException, IOException {
    if (request == null) {
      routerMetrics.incrResourceTypeInfoFailedRetrieved();
      String msg = "Missing getResourceTypeInfo request.";
      RouterAuditLogger.logFailure(user.getShortUserName(), GET_RESOURCETYPEINFO, UNKNOWN,
          TARGET_CLIENT_RM_SERVICE, msg);
      RouterServerUtil.logAndThrowException(msg, null);
    }
    long startTime = clock.getTime();
    ClientMethod remoteMethod = new ClientMethod("getResourceTypeInfo",
        new Class[] {GetAllResourceTypeInfoRequest.class}, new Object[] {request});
    Collection<GetAllResourceTypeInfoResponse> listResourceTypeInfo;
    try {
      listResourceTypeInfo = invokeConcurrent(remoteMethod, GetAllResourceTypeInfoResponse.class);
    } catch (Exception ex) {
      routerMetrics.incrResourceTypeInfoFailedRetrieved();
      String msg = "Unable to get all resource type info node due to exception.";
      LOG.error(msg, ex);
      RouterAuditLogger.logFailure(user.getShortUserName(), GET_RESOURCETYPEINFO, UNKNOWN,
          TARGET_CLIENT_RM_SERVICE, msg);
      throw ex;
    }
    long stopTime = clock.getTime();
    routerMetrics.succeededGetResourceTypeInfoRetrieved(stopTime - startTime);
    RouterAuditLogger.logSuccess(user.getShortUserName(), GET_RESOURCETYPEINFO,
        TARGET_CLIENT_RM_SERVICE);
    // Merge the GetAllResourceTypeInfoResponse
    return RouterYarnClientUtils.mergeResourceTypes(listResourceTypeInfo);
  }
@Test
  public void testGetResourceTypeInfoRequest() throws Exception {
    LOG.info("Test FederationClientInterceptor :  Get Resource TypeInfo request.");
    // null request
    LambdaTestUtils.intercept(YarnException.class, "Missing getResourceTypeInfo request.",
        () -> interceptor.getResourceTypeInfo(null));
    // normal request.
    GetAllResourceTypeInfoResponse response =
        interceptor.getResourceTypeInfo(GetAllResourceTypeInfoRequest.newInstance());
    Assert.assertEquals(2, response.getResourceTypeInfo().size());
  }