PreemptableResourceCalculatorpublic class AbstractPreemptableResourceCalculator
extends java.lang.Object
PreemptionCandidatesSelector.| Modifier and Type | Field | Description |
|---|---|---|
protected CapacitySchedulerPreemptionContext |
context |
|
protected boolean |
isReservedPreemptionCandidatesSelector |
|
protected org.apache.hadoop.yarn.util.resource.ResourceCalculator |
rc |
| Constructor | Description |
|---|---|
AbstractPreemptableResourceCalculator(CapacitySchedulerPreemptionContext preemptionContext,
boolean isReservedPreemptionCandidatesSelector,
boolean allowQueuesBalanceAfterAllQueuesSatisfied) |
PreemptableResourceCalculator constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
computeFixpointAllocation(org.apache.hadoop.yarn.api.records.Resource totGuarant,
java.util.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 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.
|
protected final CapacitySchedulerPreemptionContext context
protected final org.apache.hadoop.yarn.util.resource.ResourceCalculator rc
protected boolean isReservedPreemptionCandidatesSelector
public AbstractPreemptableResourceCalculator(CapacitySchedulerPreemptionContext preemptionContext, boolean isReservedPreemptionCandidatesSelector, boolean allowQueuesBalanceAfterAllQueuesSatisfied)
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.protected void computeFixpointAllocation(org.apache.hadoop.yarn.api.records.Resource totGuarant,
java.util.Collection<TempQueuePerPartition> qAlloc,
org.apache.hadoop.yarn.api.records.Resource unassigned,
boolean ignoreGuarantee)
totGuarant - total guaranteed resourceqAlloc - List of child queuesunassigned - Unassigned resource per queueignoreGuarantee - ignore guarantee per queue.protected void initIdealAssignment(org.apache.hadoop.yarn.api.records.Resource totGuarant,
TempQueuePerPartition q,
org.apache.hadoop.yarn.api.records.Resource initIdealAssigned)
totGuarant - total resources (useful for ResourceCalculator
operations)q - the TempQueuePerPartition being initializedinitIdealAssigned - the proposed initialization value.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.