Exemplo n.º 1
0
 @Override
 public void updateDemand() {
   // Compute demand by iterating through apps in the queue
   // Limit demand to maxResources
   Resource maxRes = scheduler.getAllocationConfiguration().getMaxResources(getName());
   demand = Resources.createResource(0);
   for (FSAppAttempt sched : runnableApps) {
     if (Resources.equals(demand, maxRes)) {
       break;
     }
     updateDemandForApp(sched, maxRes);
   }
   for (FSAppAttempt sched : nonRunnableApps) {
     if (Resources.equals(demand, maxRes)) {
       break;
     }
     updateDemandForApp(sched, maxRes);
   }
   if (LOG.isDebugEnabled()) {
     LOG.debug("The updated demand for " + getName() + " is " + demand + "; the max is " + maxRes);
   }
 }