slfan1989 commented on code in PR #4614:
URL: https://github.com/apache/hadoop/pull/4614#discussion_r928362982
##########
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:
I refactored part of the code to print and throw exceptions, so that once an
exception occurs, users can immediately find the problem.
--
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]