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
|
||||
*/
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue