@Override
  public GetQueueInfoResponse getQueueInfo(GetQueueInfoRequest request)
      throws YarnException, IOException {
    if (request == null || request.getQueueName() == null) {
      routerMetrics.incrGetQueueInfoFailedRetrieved();
      String msg = "Missing getQueueInfo request or queueName.";
      RouterAuditLogger.logFailure(user.getShortUserName(), GET_QUEUEINFO, UNKNOWN,
          TARGET_CLIENT_RM_SERVICE, msg);
      RouterServerUtil.logAndThrowException(msg, null);
    }
    String rSubCluster = request.getSubClusterId();

    long startTime = clock.getTime();
    ClientMethod remoteMethod = new ClientMethod("getQueueInfo",
        new Class[]{GetQueueInfoRequest.class}, new Object[]{request});
    Collection<GetQueueInfoResponse> queues = null;
    try {
      if (StringUtils.isNotBlank(rSubCluster)) {
        queues = invoke(remoteMethod, GetQueueInfoResponse.class, rSubCluster);
      } else {
        queues = invokeConcurrent(remoteMethod, GetQueueInfoResponse.class);
      }
    } catch (Exception ex) {
      routerMetrics.incrGetQueueInfoFailedRetrieved();
      String msg = "Unable to get queue [" + request.getQueueName() + "] to exception.";
      RouterAuditLogger.logFailure(user.getShortUserName(), GET_QUEUEINFO, UNKNOWN,
          TARGET_CLIENT_RM_SERVICE, msg);
      RouterServerUtil.logAndThrowException(msg, ex);
    }
    long stopTime = clock.getTime();
    routerMetrics.succeededGetQueueInfoRetrieved(stopTime - startTime);
    RouterAuditLogger.logSuccess(user.getShortUserName(), GET_QUEUEINFO, TARGET_CLIENT_RM_SERVICE);
    // Merge the GetQueueInfoResponse
    return RouterYarnClientUtils.mergeQueues(queues);
  }
@Test
  public void testSubClusterGetQueueInfo() throws IOException, YarnException {
    // We have set up a unit test where we access queue information for subcluster1.
    GetQueueInfoResponse response = interceptor.getQueueInfo(
        GetQueueInfoRequest.newInstance("root", true, true, true, "1"));
    Assert.assertNotNull(response);

    QueueInfo queueInfo = response.getQueueInfo();
    Assert.assertNotNull(queueInfo);
    Assert.assertEquals("root", queueInfo.getQueueName());
    Assert.assertEquals(1.0, queueInfo.getCapacity(), 0);
    Assert.assertEquals(0.0, queueInfo.getCurrentCapacity(), 0);
    Assert.assertEquals(3, queueInfo.getChildQueues().size(), 0);
    Assert.assertEquals(1, queueInfo.getAccessibleNodeLabels().size());
  }