From 0441efe1fc68b2c34019e6a711a982a3e624bb85 Mon Sep 17 00:00:00 2001 From: zhuqi-lucas <821684824@qq.com> Date: Wed, 21 Jul 2021 15:31:44 +0800 Subject: [PATCH] YARN-10860. Make max container per heartbeat configs refreshable. Contributed by Eric Badger. --- .../scheduler/capacity/CapacityScheduler.java | 11 ++++++++++- .../src/site/markdown/CapacityScheduler.md | 2 +- 2 files changed, 11 insertions(+), 2 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 ebf4b9d50a..30b00b139c 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 @@ -393,7 +393,10 @@ void initScheduler(Configuration configuration) throws + getMaximumResourceCapability() + ", " + "asynchronousScheduling=" + scheduleAsynchronously + ", " + "asyncScheduleInterval=" + asyncScheduleInterval + "ms" + ",multiNodePlacementEnabled=" - + multiNodePlacementEnabled); + + multiNodePlacementEnabled + ", " + "assignMultipleEnabled=" + + assignMultipleEnabled + ", " + "maxAssignPerHeartbeat=" + + maxAssignPerHeartbeat + ", " + "offswitchPerHeartbeatLimit=" + + offswitchPerHeartbeatLimit); } finally { writeLock.unlock(); } @@ -485,8 +488,14 @@ public void reinitialize(Configuration newConf, RMContext rmContext, this.isLazyPreemptionEnabled = this.conf.getLazyPreemptionEnabled(); // Setup how many containers we can allocate for each round + assignMultipleEnabled = this.conf.getAssignMultipleEnabled(); + maxAssignPerHeartbeat = this.conf.getMaxAssignPerHeartbeat(); offswitchPerHeartbeatLimit = this.conf.getOffSwitchPerHeartbeatLimit(); + LOG.info("assignMultipleEnabled = " + assignMultipleEnabled + "\n" + + "maxAssignPerHeartbeat = " + maxAssignPerHeartbeat + "\n" + + "offswitchPerHeartbeatLimit = " + offswitchPerHeartbeatLimit); + super.reinitialize(newConf, rmContext); } maxRunningEnforcer.updateRunnabilityOnReload(); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/CapacityScheduler.md b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/CapacityScheduler.md index 1dec2da113..4d45e7b581 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/CapacityScheduler.md +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/CapacityScheduler.md @@ -702,7 +702,7 @@ Note, this feature should be disabled if YARN is deployed separately with the fi * Container Allocation per NodeManager Heartbeat - The `CapacityScheduler` supports the following parameters to control how many containers can be allocated in each NodeManager heartbeat. + The `CapacityScheduler` supports the following parameters to control how many containers can be allocated in each NodeManager heartbeat. These parameters are refreshable via *yarn rmadmin -refreshQueues*. | Property | Description | |:---- |:---- |