YARN-5055. max apps per user can be larger than max per queue. Contributed by Eric Badger
(cherry picked from commit ac954486c5
)
This commit is contained in:
parent
8e404b4321
commit
0bfad9675e
|
@ -171,8 +171,8 @@ public class LeafQueue extends AbstractCSQueue {
|
|||
maxApplications =
|
||||
(int) (maxSystemApps * queueCapacities.getAbsoluteCapacity());
|
||||
}
|
||||
maxApplicationsPerUser =
|
||||
(int)(maxApplications * (userLimit / 100.0f) * userLimitFactor);
|
||||
maxApplicationsPerUser = Math.min(maxApplications,
|
||||
(int)(maxApplications * (userLimit / 100.0f) * userLimitFactor));
|
||||
|
||||
maxAMResourcePerQueuePercent =
|
||||
conf.getMaximumApplicationMasterResourcePerQueuePercent(getQueuePath());
|
||||
|
|
|
@ -324,8 +324,9 @@ public class TestApplicationLimits {
|
|||
queue.getAbsoluteCapacity());
|
||||
assertEquals(expectedMaxApps, queue.getMaxApplications());
|
||||
|
||||
int expectedMaxAppsPerUser = (int)(expectedMaxApps *
|
||||
(queue.getUserLimit()/100.0f) * queue.getUserLimitFactor());
|
||||
int expectedMaxAppsPerUser = Math.min(expectedMaxApps,
|
||||
(int)(expectedMaxApps * (queue.getUserLimit()/100.0f) *
|
||||
queue.getUserLimitFactor()));
|
||||
assertEquals(expectedMaxAppsPerUser, queue.getMaxApplicationsPerUser());
|
||||
|
||||
// should default to global setting if per queue setting not set
|
||||
|
@ -375,8 +376,8 @@ public class TestApplicationLimits {
|
|||
assertEquals(9999, (int)csConf.getMaximumApplicationsPerQueue(queue.getQueuePath()));
|
||||
assertEquals(9999, queue.getMaxApplications());
|
||||
|
||||
expectedMaxAppsPerUser = (int)(9999 *
|
||||
(queue.getUserLimit()/100.0f) * queue.getUserLimitFactor());
|
||||
expectedMaxAppsPerUser = Math.min(9999, (int)(9999 *
|
||||
(queue.getUserLimit()/100.0f) * queue.getUserLimitFactor()));
|
||||
assertEquals(expectedMaxAppsPerUser, queue.getMaxApplicationsPerUser());
|
||||
}
|
||||
|
||||
|
|
|
@ -438,8 +438,9 @@ public class TestRMWebServicesCapacitySched extends JerseyTestBase {
|
|||
|
||||
int maxSystemApps = csConf.getMaximumSystemApplications();
|
||||
int expectedMaxApps = (int)(maxSystemApps * (info.absoluteCapacity/100));
|
||||
int expectedMaxAppsPerUser =
|
||||
(int)(expectedMaxApps * (info.userLimit/100.0f) * info.userLimitFactor);
|
||||
int expectedMaxAppsPerUser = Math.min(expectedMaxApps,
|
||||
(int)(expectedMaxApps * (info.userLimit/100.0f) *
|
||||
info.userLimitFactor));
|
||||
|
||||
// TODO: would like to use integer comparisons here but can't due to
|
||||
// roundoff errors in absolute capacity calculations
|
||||
|
|
Loading…
Reference in New Issue