goiri commented on code in PR #4614:
URL: https://github.com/apache/hadoop/pull/4614#discussion_r928292370


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/webapp/FederationInterceptorREST.java:
##########
@@ -1172,7 +1172,21 @@ public ApplicationStatisticsInfo 
getAppStatistics(HttpServletRequest hsr,
   @Override
   public NodeToLabelsInfo getNodeToLabels(HttpServletRequest hsr)
       throws IOException {
-    throw new NotImplementedException("Code is not implemented");
+    NodeToLabelsInfo nodeToLabelsInfo;
+    try {
+      Map<SubClusterId, SubClusterInfo> subClustersActive = 
getActiveSubclusters();
+      final HttpServletRequest hsrCopy = clone(hsr);
+      Class[] argsClasses = new Class[]{HttpServletRequest.class};
+      Object[] args = new Object[]{hsrCopy};
+      ClientMethod remoteMethod = new ClientMethod("getNodeToLabels", 
argsClasses, args);
+      Map<SubClusterInfo, NodeToLabelsInfo> nodeToLabelsInfoMap =
+          invokeConcurrent(subClustersActive.values(), remoteMethod, 
NodeToLabelsInfo.class);
+      nodeToLabelsInfo = 
RouterWebServiceUtil.mergeNodeToLabels(nodeToLabelsInfoMap);

Review Comment:
   What if we just do:
   ```
   return RouterWebServiceUtil.mergeNodeToLabels(nodeToLabelsInfoMap);
   ```
   
   Not sure what the default case would look like; but I think the exception 
should just surface.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to