Skip to content

Commit fe41b76

Browse files
author
slfan1989
committed
YARN-11180. Fix CheckStyle.
1 parent 390f1f2 commit fe41b76

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/FederationClientInterceptor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -695,17 +695,17 @@ public GetClusterMetricsResponse getClusterMetrics(
695695
Map<SubClusterId, SubClusterInfo> subClusters = federationFacade.getSubClusters(true);
696696
ClientMethod remoteMethod = new ClientMethod("getClusterMetrics",
697697
new Class[] {GetClusterMetricsRequest.class}, new Object[] {request});
698-
Map<SubClusterId, GetClusterMetricsResponse> clusterMetrics = null;
698+
Collection<GetClusterMetricsResponse> clusterMetrics = null;
699699
try {
700-
Set keySet = subClusters.keySet();
701-
clusterMetrics = invokeConcurrent(keySet, remoteMethod, GetClusterMetricsResponse.class);
700+
clusterMetrics = invokeAppClientProtocolMethod(
701+
true, remoteMethod, GetClusterMetricsResponse.class);
702702
} catch (Exception ex) {
703703
routerMetrics.incrGetClusterMetricsFailedRetrieved();
704704
RouterServerUtil.logAndThrowException("Unable to get cluster metrics due to exception.", ex);
705705
}
706706
long stopTime = clock.getTime();
707707
routerMetrics.succeededGetClusterMetricsRetrieved(stopTime - startTime);
708-
return RouterYarnClientUtils.merge(clusterMetrics.values());
708+
return RouterYarnClientUtils.merge(clusterMetrics);
709709
}
710710

711711
<R> Map<SubClusterId, R> invokeConcurrent(ArrayList<SubClusterId> clusterIds,

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/clientrm/TestFederationClientInterceptor.java

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,7 @@ public void testGetClusterMetricsRequest() throws Exception {
585585
}
586586

587587
/**
588-
* This test validates the correctness of
589-
* GetApplicationsResponse in case the
588+
* This test validates the correctness of GetApplicationsResponse in case the
590589
* application exists in the cluster.
591590
*/
592591
@Test
@@ -609,8 +608,7 @@ public void testGetApplicationsResponse()
609608
}
610609

611610
/**
612-
* This test validates
613-
* the correctness of GetApplicationsResponse in case of
611+
* This test validates the correctness of GetApplicationsResponse in case of
614612
* empty request.
615613
*/
616614
@Test
@@ -621,8 +619,7 @@ public void testGetApplicationsNullRequest() throws Exception {
621619
}
622620

623621
/**
624-
* This test validates
625-
* the correctness of GetApplicationsResponse in case applications
622+
* This test validates the correctness of GetApplicationsResponse in case applications
626623
* with given type does not exist.
627624
*/
628625
@Test
@@ -647,14 +644,12 @@ public void testGetApplicationsApplicationTypeNotExists() throws Exception{
647644
}
648645

649646
/**
650-
* This test validates
651-
* the correctness of GetApplicationsResponse in case applications
647+
* This test validates the correctness of GetApplicationsResponse in case applications
652648
* with given YarnApplicationState does not exist.
653649
*/
654650
@Test
655651
public void testGetApplicationsApplicationStateNotExists() throws Exception {
656-
LOG.info("Test FederationClientInterceptor:" +
657-
" Application with state does not exist");
652+
LOG.info("Test FederationClientInterceptor: Application with state does not exist.");
658653

659654
ApplicationId appId =
660655
ApplicationId.newInstance(System.currentTimeMillis(), 1);
@@ -672,8 +667,7 @@ public void testGetApplicationsApplicationStateNotExists() throws Exception {
672667
GetApplicationsRequest requestGet =
673668
GetApplicationsRequest.newInstance(applicationStates);
674669

675-
GetApplicationsResponse responseGet =
676-
interceptor.getApplications(requestGet);
670+
GetApplicationsResponse responseGet = interceptor.getApplications(requestGet);
677671

678672
Assert.assertNotNull(responseGet);
679673
Assert.assertTrue(responseGet.getApplicationList().isEmpty());
@@ -735,7 +729,7 @@ public void testGetQueueUserAcls() throws Exception {
735729
LambdaTestUtils.intercept(YarnException.class, "Missing getQueueUserAcls request.",
736730
() -> interceptor.getQueueUserAcls(null));
737731

738-
// noraml request
732+
// normal request
739733
GetQueueUserAclsInfoResponse response = interceptor.getQueueUserAcls(
740734
GetQueueUserAclsInfoRequest.newInstance());
741735

0 commit comments

Comments
 (0)