slfan1989 commented on code in PR #4274:
URL: https://github.com/apache/hadoop/pull/4274#discussion_r870943266


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/FederationClientInterceptor.java:
##########
@@ -790,8 +791,32 @@ <R> Map<SubClusterId, R> 
invokeConcurrent(Collection<SubClusterId> clusterIds,
 
   @Override
   public GetClusterNodesResponse getClusterNodes(GetClusterNodesRequest 
request)
-      throws YarnException, IOException {
-    throw new NotImplementedException("Code is not implemented");
+          throws YarnException, IOException {
+    if (request == null) {
+      routerMetrics.incrClusterNodesFailedRetrieved();
+      RouterServerUtil.logAndThrowException(
+              "Missing getClusterNodes request.", null);
+    }
+    long startTime = clock.getTime();
+    Map<SubClusterId, SubClusterInfo> subclusters =
+            federationFacade.getSubClusters(true);
+    Map<SubClusterId, GetClusterNodesResponse> clusterNodes = 
Maps.newHashMap();
+    for (Map.Entry<SubClusterId, SubClusterInfo> entry : 
subclusters.entrySet()) {

Review Comment:
   thank you, good advice, keysets should be used.



-- 
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