-
Notifications
You must be signed in to change notification settings - Fork 9.2k
YARN-11122. Support getClusterNodes API in FederationClientInterceptor #4274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
7bd9675
2af73f5
87277d1
6630ce6
07f6090
1bf7332
b4867c0
aa49c3a
c6e404b
c7ccca5
407c039
7845199
f16651f
dde385a
72359e0
0887df5
dbd5cb3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |
|
|
||
| package org.apache.hadoop.yarn.server.router.clientrm; | ||
|
|
||
| import org.apache.hadoop.thirdparty.com.google.common.collect.Maps; | ||
| import org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder; | ||
| import java.io.IOException; | ||
| import java.lang.reflect.Method; | ||
|
|
@@ -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()) { | ||
|
||
| SubClusterId subClusterId = entry.getKey(); | ||
| ApplicationClientProtocol client = null; | ||
| try { | ||
| client = getClientRMProxyForSubCluster(subClusterId); | ||
| GetClusterNodesResponse response = client.getClusterNodes(request); | ||
| clusterNodes.put(subClusterId, response); | ||
| } catch (Exception ex) { | ||
| routerMetrics.incrClusterNodesFailedRetrieved(); | ||
| LOG.error("Unable to get cluster nodes due to exception.", ex); | ||
| } | ||
| } | ||
| long stopTime = clock.getTime(); | ||
| routerMetrics.succeededGetClusterNodesRetrieved(stopTime - startTime); | ||
| // Merge the NodesResponse | ||
| return RouterYarnClientUtils.mergeClusterNodesResponse(clusterNodes.values()); | ||
| } | ||
|
|
||
| @Override | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yetus seems not to be running the checkstyle.
Can you run it by hand and fix indentation?
CC @ayushtkn any idea on why the checkstyle is not being ran?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no problem, I'll fix the indentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It did ran @goiri for the latest 14th build, for the 5th the results aren't there now
Branch:
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4274/14/artifact/out/buildtool-branch-checkstyle-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-router.txt
Patch:
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4274/14/artifact/out/buildtool-patch-checkstyle-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-router.txt
Both have same number hence 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, the Yetus report is not showing and is giving a +1.