Skip to content

Commit

Permalink
YARN-11275. Fix CheckStyle.
Browse files Browse the repository at this point in the history
  • Loading branch information
slfan1989 committed Aug 24, 2022
1 parent e7fdf27 commit 46f8154
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -453,13 +453,21 @@ public void drainUAMHeartbeats() {
}
}

/**
* Complete FinishApplicationMaster interface calls in batches.
*
* @param request FinishApplicationMasterRequest
* @param appId application Id
* @return Returns the Map map,
* the key is subClusterId, the value is FinishApplicationMasterResponse
*/
public Map<String, FinishApplicationMasterResponse> batchFinishApplicationMaster(
FinishApplicationMasterRequest request, String appId) {

Map<String, FinishApplicationMasterResponse> responseMap = new HashMap<>();
Set<String> subClusterIds = this.unmanagedAppMasterMap.keySet();

if (subClusterIds.size() > 0) {
if (subClusterIds != null && !subClusterIds.isEmpty()) {
ExecutorCompletionService<Map<String, FinishApplicationMasterResponse>> finishAppService =
new ExecutorCompletionService<>(this.threadpool);
LOG.info("Sending finish application request to {} sub-cluster RMs", subClusterIds.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ public void testBatchFinishApplicationMaster() throws IOException, InterruptedEx
List<Container> containers =
getContainersAndAssert(numberOfContainers, numberOfContainers * 2);
Assert.assertEquals(2, interceptor.getUnmanagedAMPoolSize());
Assert.assertEquals(numberOfContainers, containers.size());
Assert.assertEquals(numberOfContainers * 2, containers.size());

// Finish the application
FinishApplicationMasterRequest finishReq =
Expand All @@ -1018,7 +1018,7 @@ public void testBatchFinishApplicationMaster() throws IOException, InterruptedEx
FinishApplicationMasterResponse finshResponse =
interceptor.finishApplicationMaster(finishReq);
Assert.assertNotNull(finshResponse);
Assert.assertEquals(true, finshResponse.getIsUnregistered());
Assert.assertTrue(finshResponse.getIsUnregistered());

return null;
});
Expand Down

0 comments on commit 46f8154

Please sign in to comment.