queueToPreemptableResourceByPartition.put(leafQueue, CapacitySchedulerPreemptionUtils .getResToObtainByPartitionForLeafQueue(preemptionContext, leafQueue, clusterResource)); for (RMContainer c : preemptionResult.selectedContainers) { CapacitySchedulerPreemptionUtils.addToPreemptMap(selectedCandidates, curCandidates, c.getApplicationAttemptId(), c);
.deductPreemptableResourcesBasedSelectedCandidates(preemptionContext, selectedCandidates); .getResToObtainByPartitionForLeafQueue(preemptionContext, queueName, clusterResource); if (CapacitySchedulerPreemptionUtils.isContainerAlreadySelected(c, selectedCandidates)) { .tryPreemptContainerAndDeductResToObtain(rc, preemptionContext, resToObtainByPartition, c, clusterResource, selectedCandidates, curCandidates,
new ArrayList<>(app.getReservedContainers()); for (RMContainer c : reservedContainers) { if (CapacitySchedulerPreemptionUtils.isContainerAlreadySelected(c, selectedContainers)) { continue; .tryPreemptContainerAndDeductResToObtain(rc, preemptionContext, resToObtainByPartition, c, clusterResource, selectedContainers, curCandidates, totalPreemptionAllowed, false); if (CapacitySchedulerPreemptionUtils.isContainerAlreadySelected(c, selectedContainers)) { continue; .tryPreemptContainerAndDeductResToObtain(rc, preemptionContext, resToObtainByPartition, c, clusterResource, selectedContainers, curCandidates, totalPreemptionAllowed, false);
if (preemptMapContains(preemptMap, attemptId, rmContainer)) { return false; String nodePartition = getPartitionByNodeId(context, rmContainer.getAllocatedNode()); Resource toObtainByPartition = resourceToObtainByPartitions addToPreemptMap(preemptMap, curCandidates, attemptId, rmContainer); return true;
if (CapacitySchedulerPreemptionUtils.isContainerAlreadySelected( runningContainer, selectedCandidates)) { Resources.subtractFrom(lacking, if (CapacitySchedulerPreemptionUtils.isContainerAlreadySelected( runningContainer, selectedCandidates)) {
.tryPreemptContainerAndDeductResToObtain(rc, preemptionContext, resToObtainByPartition, c, clusterResource, preemptMap, curCandidates, totalPreemptionAllowed, false);
.deductPreemptableResourcesBasedSelectedCandidates(preemptionContext, selectedCandidates);
deductPreemptableResourcePerApp(context, tq.totalPartitionResource, tas, res);
CapacitySchedulerPreemptionUtils.addToPreemptMap(selectedCandidates, curCandidates, c.getApplicationAttemptId(), c);
if (CapacitySchedulerPreemptionUtils.isContainerAlreadySelected(c, selectedCandidates)) { continue; .tryPreemptContainerAndDeductResToObtain(rc, preemptionContext, resToObtainByPartition, c, clusterResource, selectedCandidates, curCandidates, totalPreemptedResourceAllowed, true);
if (!CapacitySchedulerPreemptionUtils.isContainerAlreadySelected(c, selectedCandidates)) { if (!readOnly) {