Skip to content

Commit

Permalink
YARN-7707. Fix CheckStyle.
Browse files Browse the repository at this point in the history
  • Loading branch information
slfan1989 committed Jul 5, 2023
1 parent af6a643 commit 6ba01c9
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ public void setUp() throws IOException, YarnException, JAXBException {
schedulerInfos.put(subClusterIds.get(0), sti2);

stateStore = mock(FederationStateStore.class);
when(stateStore.getSubClusters((GetSubClustersInfoRequest) any()))
when(stateStore.getSubClusters(any()))
.thenReturn(GetSubClustersInfoResponse.newInstance(
new ArrayList<SubClusterInfo>(subClusterInfos.values())));
new ArrayList<>(subClusterInfos.values())));
facade.reinitialize(stateStore, conf);
}

Expand Down Expand Up @@ -220,9 +220,9 @@ public void testExistingPolicy() throws YarnException {
// Add a test policy for test queue
manager.setQueue("default");
manager.getWeightedPolicyInfo().setAMRMPolicyWeights(GPGUtils
.createUniformWeights(new HashSet<SubClusterId>(subClusterIds)));
.createUniformWeights(new HashSet<>(subClusterIds)));
manager.getWeightedPolicyInfo().setRouterPolicyWeights(GPGUtils
.createUniformWeights(new HashSet<SubClusterId>(subClusterIds)));
.createUniformWeights(new HashSet<>(subClusterIds)));
SubClusterPolicyConfiguration testConf = manager.serializeConf();
when(stateStore.getPolicyConfiguration(
GetSubClusterPolicyConfigurationRequest.newInstance("default")))
Expand Down Expand Up @@ -316,7 +316,7 @@ protected Map<SubClusterId, Map<Class, Object>> getInfos(
Map<SubClusterId, Map<Class, Object>> ret = new HashMap<>();
for (SubClusterId id : activeSubClusters.keySet()) {
if (!ret.containsKey(id)) {
ret.put(id, new HashMap<Class, Object>());
ret.put(id, new HashMap<>());
}
ret.get(id).put(ClusterMetricsInfo.class,
clusterInfos.get(id).get(ClusterMetricsInfo.class));
Expand All @@ -327,8 +327,7 @@ protected Map<SubClusterId, Map<Class, Object>> getInfos(
@Override
protected Map<SubClusterId, SchedulerInfo> getSchedulerInfo(
Map<SubClusterId, SubClusterInfo> activeSubClusters) {
Map<SubClusterId, SchedulerInfo> ret =
new HashMap<SubClusterId, SchedulerInfo>();
Map<SubClusterId, SchedulerInfo> ret = new HashMap<>();
for (SubClusterId id : activeSubClusters.keySet()) {
ret.put(id, schedulerInfos.get(id));
}
Expand Down

0 comments on commit 6ba01c9

Please sign in to comment.