use of org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.ResourceRequestUpdateResult in project hadoop by apache.
the class AppSchedulingInfo method addToPlacementSets.
boolean addToPlacementSets(boolean recoverPreemptedRequestForAContainer, Map<SchedulerRequestKey, Map<String, ResourceRequest>> dedupRequests) {
boolean offswitchResourcesUpdated = false;
for (Map.Entry<SchedulerRequestKey, Map<String, ResourceRequest>> entry : dedupRequests.entrySet()) {
SchedulerRequestKey schedulerRequestKey = entry.getKey();
if (!schedulerKeyToPlacementSets.containsKey(schedulerRequestKey)) {
schedulerKeyToPlacementSets.put(schedulerRequestKey, new LocalitySchedulingPlacementSet<>(this));
}
// Update placement set
ResourceRequestUpdateResult pendingAmountChanges = schedulerKeyToPlacementSets.get(schedulerRequestKey).updateResourceRequests(entry.getValue().values(), recoverPreemptedRequestForAContainer);
if (null != pendingAmountChanges) {
updatePendingResources(pendingAmountChanges.getLastAnyResourceRequest(), pendingAmountChanges.getNewResourceRequest(), schedulerRequestKey, queue.getMetrics());
offswitchResourcesUpdated = true;
}
}
return offswitchResourcesUpdated;
}
Aggregations