|
@@ -1660,17 +1660,25 @@ public class TestLeafQueue {
|
|
LeafQueue a = stubLeafQueue((LeafQueue)queues.get(A));
|
|
LeafQueue a = stubLeafQueue((LeafQueue)queues.get(A));
|
|
// Set minimum-user-limit-percent for queue "a" in the configs.
|
|
// Set minimum-user-limit-percent for queue "a" in the configs.
|
|
csConf.setUserLimit(a.getQueuePath(), 50);
|
|
csConf.setUserLimit(a.getQueuePath(), 50);
|
|
- // Set weight for "user_0" to be 1.5 for the a queue in the configs.
|
|
|
|
|
|
+ // Set weight for "user_0" to be 1.5f for the a queue in the configs.
|
|
csConf.setFloat("yarn.scheduler.capacity." + a.getQueuePath()
|
|
csConf.setFloat("yarn.scheduler.capacity." + a.getQueuePath()
|
|
+ ".user-settings.user_0." + CapacitySchedulerConfiguration.USER_WEIGHT,
|
|
+ ".user-settings.user_0." + CapacitySchedulerConfiguration.USER_WEIGHT,
|
|
1.5f);
|
|
1.5f);
|
|
|
|
+ // Set weight for "firstname.lastname" to be 0.7f for the a queue
|
|
|
|
+ // in the configs. Notice the user contains a dot. This is to test
|
|
|
|
+ // that weights are accepted for a username that contains dots.
|
|
|
|
+ csConf.setFloat("yarn.scheduler.capacity." + a.getQueuePath()
|
|
|
|
+ + ".user-settings.firstname.lastname."
|
|
|
|
+ + CapacitySchedulerConfiguration.USER_WEIGHT,
|
|
|
|
+ 0.7f);
|
|
|
|
|
|
when(csContext.getClusterResource())
|
|
when(csContext.getClusterResource())
|
|
.thenReturn(Resources.createResource(16 * GB, 32));
|
|
.thenReturn(Resources.createResource(16 * GB, 32));
|
|
// Verify that configs were updated and parsed correctly.
|
|
// Verify that configs were updated and parsed correctly.
|
|
Assert.assertNull(a.getUserWeights().get("user_0"));
|
|
Assert.assertNull(a.getUserWeights().get("user_0"));
|
|
a.reinitialize(a, csContext.getClusterResource());
|
|
a.reinitialize(a, csContext.getClusterResource());
|
|
- assertEquals(1.5, a.getUserWeights().get("user_0").floatValue(), 0.0);
|
|
|
|
|
|
+ assertEquals(1.5f, a.getUserWeights().get("user_0"), 0.0f);
|
|
|
|
+ assertEquals(0.7f, a.getUserWeights().get("firstname.lastname"), 0.0f);
|
|
|
|
|
|
// set maxCapacity
|
|
// set maxCapacity
|
|
a.setMaxCapacity(1.0f);
|
|
a.setMaxCapacity(1.0f);
|