akshatb1 commented on a change in pull request #3135:
URL: https://github.com/apache/hadoop/pull/3135#discussion_r658481270
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/FederationClientInterceptor.java
##########
@@ -599,10 +607,45 @@ public GetApplicationReportResponse getApplicationReport(
return response;
}
+ /**
+ * The Yarn Router will forward the request to all the Yarn RMs in parallel,
+ * after that it will group all the ApplicationReports by the ApplicationId.
+ *
+ * Possible failure:
+ *
+ * Client: identical behavior as {@code ClientRMService}.
+ *
+ * Router: the Client will timeout and resubmit the request.
+ *
+ * ResourceManager: the Router calls each Yarn RM in parallel. In case a
+ * Yarn RM fails, a single call will timeout. However the Router will
+ * merge the ApplicationReports it got, and provides a partial list to
+ * the client.
+ *
+ * State Store: the Router will timeout and it will retry depending on the
+ * FederationFacade settings - if the failure happened before the select
+ * operation.
+ */
@Override
public GetApplicationsResponse getApplications(GetApplicationsRequest
request)
throws YarnException, IOException {
- throw new NotImplementedException("Code is not implemented");
+ if (request == null) {
+ RouterServerUtil.logAndThrowException(
+ "Missing getApplications request.",
+ null);
+ }
+ Map<SubClusterId, SubClusterInfo> subclusters =
+ federationFacade.getSubClusters(true);
+ ClientMethod remoteMethod = new ClientMethod("getApplications",
+ new Class[] {GetApplicationsRequest.class}, new Object[]
{request});
+ ArrayList<SubClusterId> clusterIds = new ArrayList<>(subclusters.keySet());
+ Map<SubClusterId, GetApplicationsResponse> applications =
+ invokeConcurrent(clusterIds, remoteMethod,
+ GetApplicationsResponse.class);
+
+ //Merge the Application Reports
Review comment:
Fixed.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]