|
@@ -112,14 +112,21 @@ public class ParentQueue extends AbstractCSQueue {
|
|
|
|
|
|
public ParentQueue(CapacitySchedulerContext cs,
|
|
public ParentQueue(CapacitySchedulerContext cs,
|
|
String queueName, CSQueue parent, CSQueue old) throws IOException {
|
|
String queueName, CSQueue parent, CSQueue old) throws IOException {
|
|
- this(cs, cs.getConfiguration(), queueName, parent, old);
|
|
|
|
|
|
+ this(cs, cs.getConfiguration(), queueName, parent, old, false);
|
|
|
|
+ }
|
|
|
|
+ private ParentQueue(CapacitySchedulerContext cs,
|
|
|
|
+ CapacitySchedulerConfiguration csConf, String queueName,
|
|
|
|
+ CSQueue parent,
|
|
|
|
+ CSQueue old) throws IOException {
|
|
|
|
+ this(cs, csConf, queueName, parent, old, false);
|
|
}
|
|
}
|
|
|
|
|
|
private ParentQueue(CapacitySchedulerContext cs,
|
|
private ParentQueue(CapacitySchedulerContext cs,
|
|
CapacitySchedulerConfiguration csConf, String queueName, CSQueue parent,
|
|
CapacitySchedulerConfiguration csConf, String queueName, CSQueue parent,
|
|
- CSQueue old)
|
|
|
|
|
|
+ CSQueue old, boolean isDynamic)
|
|
throws IOException {
|
|
throws IOException {
|
|
super(cs, queueName, parent, old);
|
|
super(cs, queueName, parent, old);
|
|
|
|
+ setDynamicQueue(isDynamic);
|
|
this.scheduler = cs;
|
|
this.scheduler = cs;
|
|
this.rootQueue = (parent == null);
|
|
this.rootQueue = (parent == null);
|
|
|
|
|
|
@@ -476,26 +483,6 @@ public class ParentQueue extends AbstractCSQueue {
|
|
"numContainers=" + getNumContainers();
|
|
"numContainers=" + getNumContainers();
|
|
}
|
|
}
|
|
|
|
|
|
- private CapacitySchedulerConfiguration getConfForAutoCreatedQueue(
|
|
|
|
- String childQueuePath, boolean isLeaf) {
|
|
|
|
- // Copy existing config
|
|
|
|
- CapacitySchedulerConfiguration dupCSConfig =
|
|
|
|
- new CapacitySchedulerConfiguration(
|
|
|
|
- csContext.getConfiguration(), false);
|
|
|
|
- autoCreatedQueueTemplate.setTemplateEntriesForChild(dupCSConfig,
|
|
|
|
- childQueuePath);
|
|
|
|
- if (isLeaf) {
|
|
|
|
- // set to -1, to disable it
|
|
|
|
- dupCSConfig.setUserLimitFactor(childQueuePath, -1);
|
|
|
|
-
|
|
|
|
- // Set Max AM percentage to a higher value
|
|
|
|
- dupCSConfig.setMaximumApplicationMasterResourcePerQueuePercent(
|
|
|
|
- childQueuePath, 0.5f);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return dupCSConfig;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private CSQueue createNewQueue(String childQueuePath, boolean isLeaf)
|
|
private CSQueue createNewQueue(String childQueuePath, boolean isLeaf)
|
|
throws SchedulerDynamicEditException {
|
|
throws SchedulerDynamicEditException {
|
|
try {
|
|
try {
|
|
@@ -504,13 +491,11 @@ public class ParentQueue extends AbstractCSQueue {
|
|
childQueuePath.lastIndexOf(".") + 1);
|
|
childQueuePath.lastIndexOf(".") + 1);
|
|
|
|
|
|
if (isLeaf) {
|
|
if (isLeaf) {
|
|
- childQueue = new LeafQueue(csContext,
|
|
|
|
- getConfForAutoCreatedQueue(childQueuePath, isLeaf), queueShortName,
|
|
|
|
- this, null);
|
|
|
|
|
|
+ childQueue = new LeafQueue(csContext, csContext.getConfiguration(),
|
|
|
|
+ queueShortName, this, null, true);
|
|
} else{
|
|
} else{
|
|
- childQueue = new ParentQueue(csContext,
|
|
|
|
- getConfForAutoCreatedQueue(childQueuePath, isLeaf), queueShortName,
|
|
|
|
- this, null);
|
|
|
|
|
|
+ childQueue = new ParentQueue(csContext, csContext.getConfiguration(),
|
|
|
|
+ queueShortName, this, null, true);
|
|
}
|
|
}
|
|
childQueue.setDynamicQueue(true);
|
|
childQueue.setDynamicQueue(true);
|
|
// It should be sufficient now, we don't need to set more, because weights
|
|
// It should be sufficient now, we don't need to set more, because weights
|