Repository: hadoop Updated Branches: refs/heads/YARN-5881 39f43eb13 -> 147a5260b
YARN-7482. Max applications calculation per queue has to be retrospected with absolute resource support. Contributed by Sunil G. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/147a5260 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/147a5260 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/147a5260 Branch: refs/heads/YARN-5881 Commit: 147a5260bf35f3bd255aa26f0b50d437d0f6a947 Parents: 39f43eb Author: Rohith Sharma K S <[email protected]> Authored: Thu Nov 16 17:33:00 2017 +0530 Committer: Rohith Sharma K S <[email protected]> Committed: Thu Nov 16 17:33:00 2017 +0530 ---------------------------------------------------------------------- .../scheduler/capacity/ParentQueue.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/147a5260/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/ParentQueue.java ---------------------------------------------------------------------- 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/ParentQueue.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/ParentQueue.java index 4426916..a007f48 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/ParentQueue.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/ParentQueue.java @@ -1088,6 +1088,26 @@ public class ParentQueue extends AbstractCSQueue { childQueue.getQueueCapacities().setAbsoluteMaximumCapacity(label, (float) childQueue.getQueueCapacities().getMaximumCapacity(label) / getQueueCapacities().getAbsoluteMaximumCapacity(label)); + + // Re-visit max applications for a queue based on absolute capacity if + // needed. + if (childQueue instanceof LeafQueue) { + LeafQueue leafQueue = (LeafQueue) childQueue; + CapacitySchedulerConfiguration conf = csContext.getConfiguration(); + int maxApplications = (int) (conf.getMaximumSystemApplications() + * childQueue.getQueueCapacities().getAbsoluteCapacity(label)); + leafQueue.setMaxApplications(maxApplications); + + int maxApplicationsPerUser = Math.min(maxApplications, + (int) (maxApplications + * (leafQueue.getUsersManager().getUserLimit() / 100.0f) + * leafQueue.getUsersManager().getUserLimitFactor())); + leafQueue.setMaxApplicationsPerUser(maxApplicationsPerUser); + LOG.info("LeafQueue:" + leafQueue.getQueueName() + ", maxApplications=" + + maxApplications + ", maxApplicationsPerUser=" + + maxApplicationsPerUser + ", Abs Cap:" + + childQueue.getQueueCapacities().getAbsoluteCapacity(label)); + } } @Override --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
