goiri commented on a change in pull request #3325:
URL: https://github.com/apache/hadoop/pull/3325#discussion_r700376659
##########
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
##########
@@ -628,18 +629,29 @@ public GetApplicationReportResponse getApplicationReport(
public GetApplicationsResponse getApplications(GetApplicationsRequest
request)
throws YarnException, IOException {
if (request == null) {
+ routerMetrics.incrMultipleAppsFailedRetrieved();
RouterServerUtil.logAndThrowException(
"Missing getApplications request.",
null);
}
+ long startTime = clock.getTime();
Map<SubClusterId, SubClusterInfo> subclusters =
federationFacade.getSubClusters(true);
ClientMethod remoteMethod = new ClientMethod("getApplications",
new Class[] {GetApplicationsRequest.class}, new Object[] {request});
- Map<SubClusterId, GetApplicationsResponse> applications =
- invokeConcurrent(subclusters.keySet(), remoteMethod,
- GetApplicationsResponse.class);
+ Map<SubClusterId, GetApplicationsResponse> applications;
+
+ try {
+ applications = invokeConcurrent(subclusters.keySet(), remoteMethod,
+ GetApplicationsResponse.class);
+ } catch (Exception ex) {
Review comment:
What is this exception?
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/TestRouterMetrics.java
##########
@@ -279,6 +279,37 @@ public void testMulipleAppsReportFailed() {
metrics.getMultipleAppsFailedRetrieved());
}
+ /**
+ * This test validates the correctness of the metric: Retrieved
getClusterMetrics
+ * multiple times successfully.
+ */
+ @Test
+ public void testSucceededGetClusterMetrics() {
+ long totalGoodBefore = metrics.getNumSucceededGetClusterMetricsRetrieved();
+ goodSubCluster.getClusterMetrics(100);
+ Assert.assertEquals(totalGoodBefore + 1,
+ metrics.getNumSucceededGetClusterMetricsRetrieved());
+ Assert.assertEquals(100,
metrics.getLatencySucceededGetClusterMetricsRetrieved(),
+ 0);
Review comment:
What is the last 0?
--
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]