YARN-10127. Remove setting App Ordering Policy to ParentQueue in FSQueueConverter

Contributed by Peter Bacsko.
This commit is contained in:
Prabhu Joseph 2020-02-11 19:35:31 +05:30 committed by Prabhu Joseph
parent d7c136b9ed
commit e637797211
2 changed files with 26 additions and 24 deletions

View File

@ -294,28 +294,30 @@ public class FSQueueConverter {
* @param queue
*/
private void emitOrderingPolicy(String queueName, FSQueue queue) {
String policy = queue.getPolicy().getName();
if (queue instanceof FSLeafQueue) {
String policy = queue.getPolicy().getName();
switch (policy) {
case DominantResourceFairnessPolicy.NAME:
capacitySchedulerConfig.set(PREFIX + queueName
+ ".ordering-policy", FairSharePolicy.NAME);
break;
case FairSharePolicy.NAME:
capacitySchedulerConfig.set(PREFIX + queueName
+ ".ordering-policy", FairSharePolicy.NAME);
if (drfUsed) {
ruleHandler.handleFairAsDrf(queueName);
switch (policy) {
case DominantResourceFairnessPolicy.NAME:
capacitySchedulerConfig.set(PREFIX + queueName
+ ".ordering-policy", FairSharePolicy.NAME);
break;
case FairSharePolicy.NAME:
capacitySchedulerConfig.set(PREFIX + queueName
+ ".ordering-policy", FairSharePolicy.NAME);
if (drfUsed) {
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);
}
}

View File

@ -393,13 +393,13 @@ public class TestFSQueueConverter {
converter.convertQueueHierarchy(rootQueue);
// root
assertEquals("root ordering policy", "fair",
assertEquals("root ordering policy", null,
csConfig.get(PREFIX + "root.ordering-policy"));
assertEquals("root.default ordering policy", "fair",
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"));
assertEquals("root.users ordering policy", "fair",
assertEquals("root.users ordering policy", null,
csConfig.get(PREFIX + "root.users.ordering-policy"));
// root.users
@ -429,7 +429,7 @@ public class TestFSQueueConverter {
converter.convertQueueHierarchy(rootQueue);
verify(ruleHandler, times(6)).handleFairAsDrf(anyString());
verify(ruleHandler, times(5)).handleFairAsDrf(anyString());
}
@Test