YARN-10127. Remove setting App Ordering Policy to ParentQueue in FSQueueConverter
Contributed by Peter Bacsko.
This commit is contained in:
parent
d7c136b9ed
commit
e637797211
|
@ -294,28 +294,30 @@ public class FSQueueConverter {
|
||||||
* @param queue
|
* @param queue
|
||||||
*/
|
*/
|
||||||
private void emitOrderingPolicy(String queueName, FSQueue queue) {
|
private void emitOrderingPolicy(String queueName, FSQueue queue) {
|
||||||
String policy = queue.getPolicy().getName();
|
if (queue instanceof FSLeafQueue) {
|
||||||
|
String policy = queue.getPolicy().getName();
|
||||||
|
|
||||||
switch (policy) {
|
switch (policy) {
|
||||||
case DominantResourceFairnessPolicy.NAME:
|
case DominantResourceFairnessPolicy.NAME:
|
||||||
capacitySchedulerConfig.set(PREFIX + queueName
|
capacitySchedulerConfig.set(PREFIX + queueName
|
||||||
+ ".ordering-policy", FairSharePolicy.NAME);
|
+ ".ordering-policy", FairSharePolicy.NAME);
|
||||||
break;
|
break;
|
||||||
case FairSharePolicy.NAME:
|
case FairSharePolicy.NAME:
|
||||||
capacitySchedulerConfig.set(PREFIX + queueName
|
capacitySchedulerConfig.set(PREFIX + queueName
|
||||||
+ ".ordering-policy", FairSharePolicy.NAME);
|
+ ".ordering-policy", FairSharePolicy.NAME);
|
||||||
if (drfUsed) {
|
if (drfUsed) {
|
||||||
ruleHandler.handleFairAsDrf(queueName);
|
ruleHandler.handleFairAsDrf(queueName);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case FifoPolicy.NAME:
|
||||||
|
capacitySchedulerConfig.set(PREFIX + queueName
|
||||||
|
+ ".ordering-policy", FifoPolicy.NAME);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
String msg = String.format("Unexpected ordering policy " +
|
||||||
|
"on queue %s: %s", queue, policy);
|
||||||
|
conversionOptions.handleConversionError(msg);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case FifoPolicy.NAME:
|
|
||||||
capacitySchedulerConfig.set(PREFIX + queueName
|
|
||||||
+ ".ordering-policy", FifoPolicy.NAME);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
String msg = String.format("Unexpected ordering policy " +
|
|
||||||
"on queue %s: %s", queue, policy);
|
|
||||||
conversionOptions.handleConversionError(msg);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -393,13 +393,13 @@ public class TestFSQueueConverter {
|
||||||
converter.convertQueueHierarchy(rootQueue);
|
converter.convertQueueHierarchy(rootQueue);
|
||||||
|
|
||||||
// root
|
// root
|
||||||
assertEquals("root ordering policy", "fair",
|
assertEquals("root ordering policy", null,
|
||||||
csConfig.get(PREFIX + "root.ordering-policy"));
|
csConfig.get(PREFIX + "root.ordering-policy"));
|
||||||
assertEquals("root.default ordering policy", "fair",
|
assertEquals("root.default ordering policy", "fair",
|
||||||
csConfig.get(PREFIX + "root.default.ordering-policy"));
|
csConfig.get(PREFIX + "root.default.ordering-policy"));
|
||||||
assertEquals("root.admins ordering policy", "fair",
|
assertEquals("root.admins ordering policy", null,
|
||||||
csConfig.get(PREFIX + "root.admins.ordering-policy"));
|
csConfig.get(PREFIX + "root.admins.ordering-policy"));
|
||||||
assertEquals("root.users ordering policy", "fair",
|
assertEquals("root.users ordering policy", null,
|
||||||
csConfig.get(PREFIX + "root.users.ordering-policy"));
|
csConfig.get(PREFIX + "root.users.ordering-policy"));
|
||||||
|
|
||||||
// root.users
|
// root.users
|
||||||
|
@ -429,7 +429,7 @@ public class TestFSQueueConverter {
|
||||||
|
|
||||||
converter.convertQueueHierarchy(rootQueue);
|
converter.convertQueueHierarchy(rootQueue);
|
||||||
|
|
||||||
verify(ruleHandler, times(6)).handleFairAsDrf(anyString());
|
verify(ruleHandler, times(5)).handleFairAsDrf(anyString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue