Skip to content

Commit e753a5f

Browse files
author
slfan1989
committed
YARN-11371. Fix CheckStyle.
1 parent e22cda2 commit e753a5f

File tree

1 file changed

+0
-36
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router

1 file changed

+0
-36
lines changed

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

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -470,42 +470,6 @@ public static void validateContainerId(String containerId)
470470
}
471471
}
472472

473-
/**
474-
* Randomly pick ActiveSubCluster.
475-
* During the selection process, we will exclude SubClusters from the blacklist.
476-
*
477-
* @param activeSubClusters List of active subClusters.
478-
* @param blackList blacklist.
479-
* @return Active SubClusterId.
480-
* @throws YarnException When there is no Active SubCluster,
481-
* an exception will be thrown (No active SubCluster available to submit the request.)
482-
*/
483-
public static SubClusterId getRandomActiveSubCluster(
484-
Map<SubClusterId, SubClusterInfo> activeSubClusters, List<SubClusterId> blackList)
485-
throws YarnException {
486-
487-
// Check if activeSubClusters is empty, if it is empty, we need to throw an exception
488-
if (MapUtils.isEmpty(activeSubClusters)) {
489-
logAndThrowException(FederationPolicyUtils.NO_ACTIVE_SUBCLUSTER_AVAILABLE, null);
490-
}
491-
492-
// Change activeSubClusters to List
493-
List<SubClusterId> subClusterIds = new ArrayList<>(activeSubClusters.keySet());
494-
495-
// If the blacklist is not empty, we need to remove all the subClusters in the blacklist
496-
if (CollectionUtils.isNotEmpty(blackList)) {
497-
subClusterIds.removeAll(blackList);
498-
}
499-
500-
// Check there are still active subcluster after removing the blacklist
501-
if (CollectionUtils.isEmpty(subClusterIds)) {
502-
logAndThrowException(FederationPolicyUtils.NO_ACTIVE_SUBCLUSTER_AVAILABLE, null);
503-
}
504-
505-
// Randomly choose a SubCluster
506-
return subClusterIds.get(rand.nextInt(subClusterIds.size()));
507-
}
508-
509473
public static UserGroupInformation setupUser(final String userName) {
510474
UserGroupInformation user = null;
511475
try {

0 commit comments

Comments
 (0)