@Override
  public CheckForDecommissioningNodesResponse checkForDecommissioningNodes(
      CheckForDecommissioningNodesRequest request) throws YarnException, IOException {

    // Parameter check
    if (request == null) {
      RouterServerUtil.logAndThrowException("Missing checkForDecommissioningNodes request.", null);
      routerMetrics.incrCheckForDecommissioningNodesFailedRetrieved();
    }

    String subClusterId = request.getSubClusterId();
    if (StringUtils.isBlank(subClusterId)) {
      routerMetrics.incrCheckForDecommissioningNodesFailedRetrieved();
      RouterServerUtil.logAndThrowException("Missing checkForDecommissioningNodes SubClusterId.",
          null);
    }

    try {
      long startTime = clock.getTime();
      RMAdminProtocolMethod remoteMethod = new RMAdminProtocolMethod(
          new Class[]{CheckForDecommissioningNodesRequest.class}, new Object[]{request});

      Collection<CheckForDecommissioningNodesResponse> responses =
          remoteMethod.invokeConcurrent(this, CheckForDecommissioningNodesResponse.class,
          subClusterId);

      if (CollectionUtils.isNotEmpty(responses)) {
        // We selected a subCluster, the list is not empty and size=1.
        List<CheckForDecommissioningNodesResponse> collects =
            responses.stream().collect(Collectors.toList());
        if (!collects.isEmpty() && collects.size() == 1) {
          CheckForDecommissioningNodesResponse response = collects.get(0);
          long stopTime = clock.getTime();
          routerMetrics.succeededCheckForDecommissioningNodesRetrieved((stopTime - startTime));
          Set<NodeId> nodes = response.getDecommissioningNodes();
          return CheckForDecommissioningNodesResponse.newInstance(nodes);
        }
      }
    } catch (YarnException e) {
      routerMetrics.incrCheckForDecommissioningNodesFailedRetrieved();
      RouterServerUtil.logAndThrowException(e,
          "Unable to checkForDecommissioningNodes due to exception " + e.getMessage());
    }

    routerMetrics.incrCheckForDecommissioningNodesFailedRetrieved();
    throw new YarnException("Unable to checkForDecommissioningNodes.");
  }
@Test
  public void testCheckForDecommissioningNodesNormalRequest() throws Exception {
    CheckForDecommissioningNodesRequest request =
        CheckForDecommissioningNodesRequest.newInstance("SC-1");
    CheckForDecommissioningNodesResponse response =
        interceptor.checkForDecommissioningNodes(request);
    assertNotNull(response);
    Set<NodeId> nodeIds = response.getDecommissioningNodes();
    assertNotNull(nodeIds);
    assertEquals(0, nodeIds.size());
  }