From 29957d08300d55986c136372850ca0ae2bb65f3a Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Thu, 5 Dec 2019 12:46:14 +0100 Subject: [PATCH] YARN-10006. IOException used in place of YARNException in CapaitySheduler --- .../scheduler/capacity/CapacityScheduler.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java index 7611bb663ea..fcc05602871 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java @@ -323,7 +323,7 @@ public void setRMContext(RMContext rmContext) { @VisibleForTesting void initScheduler(Configuration configuration) throws - IOException { + IOException, YarnException { writeLock.lock(); try { String confProviderStr = configuration.get( @@ -768,16 +768,19 @@ public void updatePlacementRules() throws IOException { @Lock(CapacityScheduler.class) private void initializeQueues(CapacitySchedulerConfiguration conf) - throws IOException { - - this.queueManager.initializeQueues(conf); + throws YarnException { + try { + this.queueManager.initializeQueues(conf); - updatePlacementRules(); + updatePlacementRules(); - this.workflowPriorityMappingsMgr.initialize(this); + this.workflowPriorityMappingsMgr.initialize(this); - // Notify Preemption Manager - preemptionManager.refreshQueues(null, this.getRootQueue()); + // Notify Preemption Manager + preemptionManager.refreshQueues(null, this.getRootQueue()); + } catch (Exception e) { + throw new YarnException("Failed to initialize queues", e); + } } @Lock(CapacityScheduler.class) -- 2.21.0