private int refreshNodes(boolean graceful, String subClusterId)
      throws IOException, YarnException {
    // Refresh the nodes
    ResourceManagerAdministrationProtocol adminProtocol = createAdminProtocol();
    RefreshNodesRequest request = RefreshNodesRequest.newInstance(
        graceful? DecommissionType.GRACEFUL : DecommissionType.NORMAL);
    if (isYarnFederationEnabled(getConf()) && StringUtils.isNotBlank(subClusterId)) {
      request.setSubClusterId(subClusterId);
    }
    adminProtocol.refreshNodes(request);
    return 0;
  }
@Test
  public void testRefreshNodes() throws Exception {
    String[] args = { "-refreshNodes" };
    assertEquals(0, rmAdminCLI.run(args));
    verify(admin).refreshNodes(any(RefreshNodesRequest.class));
  }