FederationInterceptorREST extends AbstractRESTRequestInterceptor { @Override public NodeInfo getNode(String nodeId) { final Map<SubClusterId, SubClusterInfo> subClustersActive = getActiveSubclusters(); if (subClustersActive.isEmpty()) { throw new NotFoundException( FederationPolicyUtils.NO_ACTIVE_SUBCLUSTER_AVAILABLE); } final Map<SubClusterInfo, NodeInfo> results = getNode(subClustersActive.values(), nodeId); NodeInfo nodeInfo = null; for (NodeInfo nodeResponse : results.values()) { try { if (nodeInfo == null || nodeInfo.getLastHealthUpdate() < nodeResponse.getLastHealthUpdate()) { nodeInfo = nodeResponse; } } catch (Throwable e) { LOG.warn("Failed to get node report ", e); } } if (nodeInfo == null) { throw new NotFoundException("nodeId, " + nodeId + ", is not found"); } return nodeInfo; }  @Override void init(String user); @Override Response createNewApplication(HttpServletRequest hsr); @Override Response submitApplication(ApplicationSubmissionContextInfo newApp,
      HttpServletRequest hsr); @Override AppInfo getApp(HttpServletRequest hsr, String appId,
      Set<String> unselectedFields); @Override Response updateAppState(AppState targetState, HttpServletRequest hsr,
      String appId); @Override AppsInfo getApps(HttpServletRequest hsr, String stateQuery,
      Set<String> statesQuery, String finalStatusQuery, String userQuery,
      String queueQuery, String count, String startedBegin, String startedEnd,
      String finishBegin, String finishEnd, Set<String> applicationTypes,
      Set<String> applicationTags, String name, Set<String> unselectedFields); @Override NodeInfo getNode(String nodeId); @Override NodesInfo getNodes(String states); @Override ResourceInfo updateNodeResource(HttpServletRequest hsr,
      String nodeId, ResourceOptionInfo resourceOption); @Override ClusterMetricsInfo getClusterMetricsInfo(); @Override AppState getAppState(HttpServletRequest hsr, String appId); @Override ClusterInfo get(); @Override ClusterInfo getClusterInfo(); @Override ClusterUserInfo getClusterUserInfo(HttpServletRequest hsr); @Override SchedulerTypeInfo getSchedulerInfo(); @Override String dumpSchedulerLogs(String time, HttpServletRequest hsr); @Override ActivitiesInfo getActivities(HttpServletRequest hsr, String nodeId,
      String groupBy); @Override BulkActivitiesInfo getBulkActivities(HttpServletRequest hsr,
      String groupBy, int activitiesCount); @Override AppActivitiesInfo getAppActivities(HttpServletRequest hsr,
      String appId, String time, Set<String> requestPriorities,
      Set<String> allocationRequestIds, String groupBy, String limit,
      Set<String> actions, boolean summarize); @Override ApplicationStatisticsInfo getAppStatistics(HttpServletRequest hsr,
      Set<String> stateQueries, Set<String> typeQueries); @Override NodeToLabelsInfo getNodeToLabels(HttpServletRequest hsr); @Override LabelsToNodesInfo getLabelsToNodes(Set<String> labels); @Override Response replaceLabelsOnNodes(NodeToLabelsEntryList newNodeToLabels,
      HttpServletRequest hsr); @Override Response replaceLabelsOnNode(Set<String> newNodeLabelsName,
      HttpServletRequest hsr, String nodeId); @Override NodeLabelsInfo getClusterNodeLabels(HttpServletRequest hsr); @Override Response addToClusterNodeLabels(NodeLabelsInfo newNodeLabels,
      HttpServletRequest hsr); @Override Response removeFromCluserNodeLabels(Set<String> oldNodeLabels,
      HttpServletRequest hsr); @Override NodeLabelsInfo getLabelsOnNode(HttpServletRequest hsr, String nodeId); @Override AppPriority getAppPriority(HttpServletRequest hsr, String appId); @Override Response updateApplicationPriority(AppPriority targetPriority,
      HttpServletRequest hsr, String appId); @Override AppQueue getAppQueue(HttpServletRequest hsr, String appId); @Override Response updateAppQueue(AppQueue targetQueue, HttpServletRequest hsr,
      String appId); @Override Response postDelegationToken(DelegationToken tokenData,
      HttpServletRequest hsr); @Override Response postDelegationTokenExpiration(HttpServletRequest hsr); @Override Response cancelDelegationToken(HttpServletRequest hsr); @Override Response createNewReservation(HttpServletRequest hsr); @Override Response submitReservation(ReservationSubmissionRequestInfo resContext,
      HttpServletRequest hsr); @Override Response updateReservation(ReservationUpdateRequestInfo resContext,
      HttpServletRequest hsr); @Override Response deleteReservation(ReservationDeleteRequestInfo resContext,
      HttpServletRequest hsr); @Override Response listReservation(String queue, String reservationId,
      long startTime, long endTime, boolean includeResourceAllocations,
      HttpServletRequest hsr); @Override AppTimeoutInfo getAppTimeout(HttpServletRequest hsr, String appId,
      String type); @Override AppTimeoutsInfo getAppTimeouts(HttpServletRequest hsr, String appId); @Override Response updateApplicationTimeout(AppTimeoutInfo appTimeout,
      HttpServletRequest hsr, String appId); @Override AppAttemptsInfo getAppAttempts(HttpServletRequest hsr, String appId); @Override RMQueueAclInfo checkUserAccessToQueue(String queue, String username,
      String queueAclType, HttpServletRequest hsr); @Override AppAttemptInfo getAppAttempt(HttpServletRequest req,
      HttpServletResponse res, String appId, String appAttemptId); @Override ContainersInfo getContainers(HttpServletRequest req,
      HttpServletResponse res, String appId, String appAttemptId); @Override ContainerInfo getContainer(HttpServletRequest req,
      HttpServletResponse res, String appId, String appAttemptId,
      String containerId); @Override void setNextInterceptor(RESTRequestInterceptor next); @Override Response signalToContainer(String containerId, String command,
      HttpServletRequest req); @Override void shutdown();  }
@Test public void testGetNode() { NodeInfo responseGet = interceptor.getNode("testGetNode"); Assert.assertNotNull(responseGet); Assert.assertEquals(NUM_SUBCLUSTER - 1, responseGet.getLastHealthUpdate()); }