Class AbstractPreemptableResourceCalculator
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.AbstractPreemptableResourceCalculator
- Direct Known Subclasses:
PreemptableResourceCalculator
Calculate how much resources need to be preempted for each queue,
will be used by
PreemptionCandidatesSelector.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CapacitySchedulerPreemptionContextprotected booleanprotected final org.apache.hadoop.yarn.util.resource.ResourceCalculator -
Constructor Summary
ConstructorsConstructorDescriptionAbstractPreemptableResourceCalculator(CapacitySchedulerPreemptionContext preemptionContext, boolean isReservedPreemptionCandidatesSelector, boolean allowQueuesBalanceAfterAllQueuesSatisfied) PreemptableResourceCalculator constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcomputeFixpointAllocation(org.apache.hadoop.yarn.api.records.Resource totGuarant, Collection<TempQueuePerPartition> qAlloc, org.apache.hadoop.yarn.api.records.Resource unassigned, boolean ignoreGuarantee) Given a set of queues compute the fix-point distribution of unassigned resources among them.protected voidinitIdealAssignment(org.apache.hadoop.yarn.api.records.Resource totGuarant, TempQueuePerPartition q, org.apache.hadoop.yarn.api.records.Resource initIdealAssigned) This method is visible to allow sub-classes to override the initialization behavior.
-
Field Details
-
context
-
rc
protected final org.apache.hadoop.yarn.util.resource.ResourceCalculator rc -
isReservedPreemptionCandidatesSelector
protected boolean isReservedPreemptionCandidatesSelector
-
-
Constructor Details
-
AbstractPreemptableResourceCalculator
public AbstractPreemptableResourceCalculator(CapacitySchedulerPreemptionContext preemptionContext, boolean isReservedPreemptionCandidatesSelector, boolean allowQueuesBalanceAfterAllQueuesSatisfied) PreemptableResourceCalculator constructor.- Parameters:
preemptionContext- contextisReservedPreemptionCandidatesSelector- this will be set by different implementation of candidate selectors, please refer to TempQueuePerPartition#offer for details.allowQueuesBalanceAfterAllQueuesSatisfied- Should resources be preempted from an over-served queue when the requesting queues are all at or over their guarantees? An example is, there're 10 queues under root, guaranteed resource of them are all 10%. Assume there're two queues are using resources, queueA uses 10% queueB uses 90%. For all queues are guaranteed, but it's not fair for queueA. We wanna make this behavior can be configured. By default it is not allowed.
-
-
Method Details
-
computeFixpointAllocation
protected void computeFixpointAllocation(org.apache.hadoop.yarn.api.records.Resource totGuarant, Collection<TempQueuePerPartition> qAlloc, org.apache.hadoop.yarn.api.records.Resource unassigned, boolean ignoreGuarantee) Given a set of queues compute the fix-point distribution of unassigned resources among them. As pending request of a queue are exhausted, the queue is removed from the set and remaining capacity redistributed among remaining queues. The distribution is weighted based on guaranteed capacity, unless asked to ignoreGuarantee, in which case resources are distributed uniformly.- Parameters:
totGuarant- total guaranteed resourceqAlloc- List of child queuesunassigned- Unassigned resource per queueignoreGuarantee- ignore guarantee per queue.
-
initIdealAssignment
protected void initIdealAssignment(org.apache.hadoop.yarn.api.records.Resource totGuarant, TempQueuePerPartition q, org.apache.hadoop.yarn.api.records.Resource initIdealAssigned) This method is visible to allow sub-classes to override the initialization behavior.- Parameters:
totGuarant- total resources (useful forResourceCalculatoroperations)q- theTempQueuePerPartitionbeing initializedinitIdealAssigned- the proposed initialization value.
-