|
18 | 18 |
|
19 | 19 | package org.apache.hadoop.yarn.server.federation.policies.amrmproxy;
|
20 | 20 |
|
| 21 | +import java.io.IOException; |
21 | 22 | import java.util.ArrayList;
|
22 | 23 | import java.util.Collection;
|
23 | 24 | import java.util.HashMap;
|
|
34 | 35 |
|
35 | 36 | import org.apache.commons.collections4.MapUtils;
|
36 | 37 | import org.apache.hadoop.conf.Configuration;
|
| 38 | +import org.apache.hadoop.ipc.RetriableException; |
37 | 39 | import org.apache.hadoop.util.StringUtils;
|
38 | 40 | import org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse;
|
39 | 41 | import org.apache.hadoop.yarn.api.records.EnhancedHeadroom;
|
|
46 | 48 | import org.apache.hadoop.yarn.server.federation.policies.dao.WeightedPolicyInfo;
|
47 | 49 | import org.apache.hadoop.yarn.server.federation.policies.exceptions.FederationPolicyException;
|
48 | 50 | import org.apache.hadoop.yarn.server.federation.policies.exceptions.FederationPolicyInitializationException;
|
49 |
| -import org.apache.hadoop.yarn.server.federation.policies.exceptions.NoActiveSubclustersException; |
50 | 51 | import org.apache.hadoop.yarn.server.federation.resolver.SubClusterResolver;
|
51 | 52 | import org.apache.hadoop.yarn.server.federation.store.records.SubClusterId;
|
52 | 53 | import org.apache.hadoop.yarn.server.federation.store.records.SubClusterIdInfo;
|
@@ -267,7 +268,7 @@ public void notifyOfResponse(SubClusterId subClusterId,
|
267 | 268 | @Override
|
268 | 269 | public Map<SubClusterId, List<ResourceRequest>> splitResourceRequests(
|
269 | 270 | List<ResourceRequest> resourceRequests,
|
270 |
| - Set<SubClusterId> timedOutSubClusters) throws YarnException { |
| 271 | + Set<SubClusterId> timedOutSubClusters) throws YarnException, IOException { |
271 | 272 |
|
272 | 273 | // object used to accumulate statistics about the answer, initialize with
|
273 | 274 | // active subclusters. Create a new instance per call because this method
|
@@ -712,7 +713,8 @@ protected final class AllocationBookkeeper {
|
712 | 713 |
|
713 | 714 | private void reinitialize(
|
714 | 715 | Map<SubClusterId, SubClusterInfo> activeSubclusters,
|
715 |
| - Set<SubClusterId> timedOutSubClusters, Configuration pConf) throws YarnException { |
| 716 | + Set<SubClusterId> timedOutSubClusters, Configuration pConf) |
| 717 | + throws YarnException, IOException { |
716 | 718 |
|
717 | 719 | if (MapUtils.isEmpty(activeSubclusters)) {
|
718 | 720 | throw new YarnRuntimeException("null activeSubclusters received");
|
@@ -752,7 +754,7 @@ private void reinitialize(
|
752 | 754 | String errorMsg = "None of the subClusters enabled in this Policy (weight > 0) are "
|
753 | 755 | + "currently active we cannot forward the ResourceRequest(s)";
|
754 | 756 | if (failOnError) {
|
755 |
| - throw new NoActiveSubclustersException(errorMsg); |
| 757 | + throw new RetriableException(errorMsg); |
756 | 758 | } else {
|
757 | 759 | LOG.error(errorMsg + ", continuing by enabling all active subClusters.");
|
758 | 760 | activeAndEnabledSC.addAll(activeSubclusters.keySet());
|
|
0 commit comments