|
@@ -268,20 +268,16 @@ public class FSLeafQueue extends FSQueue {
|
|
readLock.lock();
|
|
readLock.lock();
|
|
try {
|
|
try {
|
|
for (FSAppAttempt sched : runnableApps) {
|
|
for (FSAppAttempt sched : runnableApps) {
|
|
- if (Resources.equals(demand, maxShare)) {
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- updateDemandForApp(sched, maxShare);
|
|
|
|
|
|
+ updateDemandForApp(sched);
|
|
}
|
|
}
|
|
for (FSAppAttempt sched : nonRunnableApps) {
|
|
for (FSAppAttempt sched : nonRunnableApps) {
|
|
- if (Resources.equals(demand, maxShare)) {
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- updateDemandForApp(sched, maxShare);
|
|
|
|
|
|
+ updateDemandForApp(sched);
|
|
}
|
|
}
|
|
} finally {
|
|
} finally {
|
|
readLock.unlock();
|
|
readLock.unlock();
|
|
}
|
|
}
|
|
|
|
+ // Cap demand to maxShare to limit allocation to maxShare
|
|
|
|
+ demand = Resources.componentwiseMin(demand, maxShare);
|
|
if (LOG.isDebugEnabled()) {
|
|
if (LOG.isDebugEnabled()) {
|
|
LOG.debug("The updated demand for " + getName() + " is " + demand
|
|
LOG.debug("The updated demand for " + getName() + " is " + demand
|
|
+ "; the max is " + maxShare);
|
|
+ "; the max is " + maxShare);
|
|
@@ -290,7 +286,7 @@ public class FSLeafQueue extends FSQueue {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void updateDemandForApp(FSAppAttempt sched, Resource maxRes) {
|
|
|
|
|
|
+ private void updateDemandForApp(FSAppAttempt sched) {
|
|
sched.updateDemand();
|
|
sched.updateDemand();
|
|
Resource toAdd = sched.getDemand();
|
|
Resource toAdd = sched.getDemand();
|
|
if (LOG.isDebugEnabled()) {
|
|
if (LOG.isDebugEnabled()) {
|
|
@@ -299,7 +295,6 @@ public class FSLeafQueue extends FSQueue {
|
|
+ demand);
|
|
+ demand);
|
|
}
|
|
}
|
|
demand = Resources.add(demand, toAdd);
|
|
demand = Resources.add(demand, toAdd);
|
|
- demand = Resources.componentwiseMin(demand, maxRes);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|