public class PreemptableResourceCalculator extends AbstractPreemptableResourceCalculator
PreemptionCandidatesSelectorcontext, isReservedPreemptionCandidatesSelector, rc| Constructor and Description | 
|---|
| PreemptableResourceCalculator(CapacitySchedulerPreemptionContext preemptionContext,
                             boolean isReservedPreemptionCandidatesSelector,
                             boolean allowQueuesBalanceAfterAllQueuesSatisfied)PreemptableResourceCalculator constructor | 
| Modifier and Type | Method and Description | 
|---|---|
| void | computeIdealAllocation(org.apache.hadoop.yarn.api.records.Resource clusterResource,
                      org.apache.hadoop.yarn.api.records.Resource totalPreemptionAllowed) | 
| protected void | computeIdealResourceDistribution(org.apache.hadoop.yarn.util.resource.ResourceCalculator rc,
                                List<TempQueuePerPartition> queues,
                                org.apache.hadoop.yarn.api.records.Resource totalPreemptionAllowed,
                                org.apache.hadoop.yarn.api.records.Resource tot_guarant)This method computes (for a single level in the tree, passed as a  List<TempQueue>) the ideal assignment of resources. | 
| protected void | recursivelyComputeIdealAssignment(TempQueuePerPartition root,
                                 org.apache.hadoop.yarn.api.records.Resource totalPreemptionAllowed)This method recursively computes the ideal assignment of resources to each
 level of the hierarchy. | 
computeFixpointAllocation, initIdealAssignmentpublic PreemptableResourceCalculator(CapacitySchedulerPreemptionContext preemptionContext, boolean isReservedPreemptionCandidatesSelector, boolean allowQueuesBalanceAfterAllQueuesSatisfied)
preemptionContext - isReservedPreemptionCandidatesSelector - this will be set by
 different implementation of candidate selectors, please refer to
 TempQueuePerPartition#offer for details.allowQueuesBalanceAfterAllQueuesSatisfied - protected void computeIdealResourceDistribution(org.apache.hadoop.yarn.util.resource.ResourceCalculator rc,
                                                List<TempQueuePerPartition> queues,
                                                org.apache.hadoop.yarn.api.records.Resource totalPreemptionAllowed,
                                                org.apache.hadoop.yarn.api.records.Resource tot_guarant)
List<TempQueue>) the ideal assignment of resources. This is done
 recursively to allocate capacity fairly across all queues with pending
 demands. It terminates when no resources are left to assign, or when all
 demand is satisfied.rc - resource calculatorqueues - a list of cloned queues to be assigned capacity to (this is
 an out param)totalPreemptionAllowed - total amount of preemption we allowtot_guarant - the amount of capacity assigned to this pool of queuesprotected void recursivelyComputeIdealAssignment(TempQueuePerPartition root, org.apache.hadoop.yarn.api.records.Resource totalPreemptionAllowed)
root - the root of the cloned queue hierachytotalPreemptionAllowed - maximum amount of preemption allowedpublic void computeIdealAllocation(org.apache.hadoop.yarn.api.records.Resource clusterResource,
                                   org.apache.hadoop.yarn.api.records.Resource totalPreemptionAllowed)
Copyright © 2008–2023 Apache Software Foundation. All rights reserved.