slfan1989 commented on PR #4250:
URL: https://github.com/apache/hadoop/pull/4250#issuecomment-1114552633
I need to ask a question, is it necessary to use a multi-threaded method
when acquiring sub-clusters, can it not be traversed directly through a for
loop? I tried to rewrite part of the code, can you help me to review it.
`Map<SubClusterId, SubClusterInfo> subclusters =
federationFacade.getSubClusters(true);
Set<SubClusterId> subClusterIds = subclusters.keySet();
Map<SubClusterId, GetClusterMetricsResponse> clusterMetrics =
Maps.newHashMap();
for (SubClusterId subClusterId : subClusterIds) {
ApplicationClientProtocol protocol =
getClientRMProxyForSubCluster(subClusterId);
GetClusterMetricsResponse metricsResponse =
protocol.getClusterMetrics(request);
clusterMetrics.put(subClusterId,metricsResponse);
}
return RouterYarnClientUtils.merge(clusterMetrics.values());`
--
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]