CapacitySchedulerPreemptionContext, SchedulingEditPolicypublic class ProportionalCapacityPreemptionPolicy extends java.lang.Object implements SchedulingEditPolicy, CapacitySchedulerPreemptionContext
SchedulingEditPolicy that is designed to be
paired with the CapacityScheduler. At every invocation of
editSchedule() it computes the ideal amount of resources assigned to each
queue (for each queue in the hierarchy), and determines whether preemption
is needed. Overcapacity is distributed among queues in a weighted fair manner,
where the weight is the amount of guaranteed capacity for the queue.
Based on this ideal assignment it determines whether preemption is required
and select a set of containers from each application that would be killed if
the corresponding amount of resources is not freed up by the application.
If not in observeOnly mode, it triggers preemption requests via a
ContainerPreemptEvent that the ResourceManager will ensure
to deliver to the application (or to execute).
If the deficit of resources is persistent over a long enough period of time
this policy will trigger forced termination of containers (again by generating
ContainerPreemptEvent).| Modifier and Type | Class | Description |
|---|---|---|
static class |
ProportionalCapacityPreemptionPolicy.IntraQueuePreemptionOrderPolicy |
IntraQueuePreemptionOrder will be used to define various priority orders
which could be configured by admin.
|
| Constructor | Description |
|---|---|
ProportionalCapacityPreemptionPolicy() |
|
ProportionalCapacityPreemptionPolicy(RMContext context,
CapacityScheduler scheduler,
org.apache.hadoop.yarn.util.Clock clock) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addPartitionToUnderServedQueues(java.lang.String queueName,
java.lang.String partition) |
|
void |
editSchedule() |
This method is invoked at regular intervals.
|
java.util.Set<java.lang.String> |
getAllPartitions() |
|
int |
getClusterMaxApplicationPriority() |
|
boolean |
getCrossQueuePreemptionConservativeDRF() |
|
long |
getDefaultMaximumKillWaitTimeout() |
|
boolean |
getInQueuePreemptionConservativeDRF() |
|
ProportionalCapacityPreemptionPolicy.IntraQueuePreemptionOrderPolicy |
getIntraQueuePreemptionOrderPolicy() |
|
java.util.Set<org.apache.hadoop.yarn.api.records.ContainerId> |
getKillableContainers() |
|
java.util.Set<java.lang.String> |
getLeafQueueNames() |
|
float |
getMaxAllowableLimitForIntraQueuePreemption() |
|
double |
getMaxIgnoreOverCapacity() |
|
float |
getMinimumThresholdForIntraQueuePreemption() |
|
long |
getMonitoringInterval() |
|
double |
getNaturalTerminationFactor() |
|
org.apache.hadoop.yarn.api.records.Resource |
getPartitionResource(java.lang.String partition) |
|
java.lang.String |
getPolicyName() |
|
TempQueuePerPartition |
getQueueByPartition(java.lang.String queueName,
java.lang.String partition) |
Get queue partition by given queueName and partitionName
|
java.util.Collection<TempQueuePerPartition> |
getQueuePartitions(java.lang.String queueName) |
Get all queue partitions by given queueName
|
org.apache.hadoop.yarn.util.resource.ResourceCalculator |
getResourceCalculator() |
|
RMContext |
getRMContext() |
|
CapacityScheduler |
getScheduler() |
|
java.util.Map<RMContainer,java.lang.Long> |
getToPreemptContainers() |
|
java.util.LinkedHashSet<java.lang.String> |
getUnderServedQueuesPerPartition(java.lang.String partition) |
|
void |
init(org.apache.hadoop.conf.Configuration config,
RMContext context,
ResourceScheduler sched) |
|
boolean |
isObserveOnly() |
public ProportionalCapacityPreemptionPolicy()
@VisibleForTesting public ProportionalCapacityPreemptionPolicy(RMContext context, CapacityScheduler scheduler, org.apache.hadoop.yarn.util.Clock clock)
public void init(org.apache.hadoop.conf.Configuration config,
RMContext context,
ResourceScheduler sched)
init in interface SchedulingEditPolicypublic org.apache.hadoop.yarn.util.resource.ResourceCalculator getResourceCalculator()
getResourceCalculator in interface CapacitySchedulerPreemptionContextpublic void editSchedule()
SchedulingEditPolicyeditSchedule in interface SchedulingEditPolicypublic long getMonitoringInterval()
getMonitoringInterval in interface SchedulingEditPolicypublic java.lang.String getPolicyName()
getPolicyName in interface SchedulingEditPolicy@VisibleForTesting public java.util.Map<RMContainer,java.lang.Long> getToPreemptContainers()
public TempQueuePerPartition getQueueByPartition(java.lang.String queueName, java.lang.String partition)
getQueueByPartition in interface CapacitySchedulerPreemptionContextpublic java.util.Collection<TempQueuePerPartition> getQueuePartitions(java.lang.String queueName)
getQueuePartitions in interface CapacitySchedulerPreemptionContextpublic CapacityScheduler getScheduler()
getScheduler in interface CapacitySchedulerPreemptionContextpublic RMContext getRMContext()
getRMContext in interface CapacitySchedulerPreemptionContextpublic boolean isObserveOnly()
isObserveOnly in interface CapacitySchedulerPreemptionContextpublic java.util.Set<org.apache.hadoop.yarn.api.records.ContainerId> getKillableContainers()
getKillableContainers in interface CapacitySchedulerPreemptionContextpublic double getMaxIgnoreOverCapacity()
getMaxIgnoreOverCapacity in interface CapacitySchedulerPreemptionContextpublic double getNaturalTerminationFactor()
getNaturalTerminationFactor in interface CapacitySchedulerPreemptionContextpublic java.util.Set<java.lang.String> getLeafQueueNames()
getLeafQueueNames in interface CapacitySchedulerPreemptionContextpublic java.util.Set<java.lang.String> getAllPartitions()
getAllPartitions in interface CapacitySchedulerPreemptionContextpublic int getClusterMaxApplicationPriority()
getClusterMaxApplicationPriority in interface CapacitySchedulerPreemptionContextpublic float getMaxAllowableLimitForIntraQueuePreemption()
getMaxAllowableLimitForIntraQueuePreemption in interface CapacitySchedulerPreemptionContextpublic float getMinimumThresholdForIntraQueuePreemption()
getMinimumThresholdForIntraQueuePreemption in interface CapacitySchedulerPreemptionContextpublic org.apache.hadoop.yarn.api.records.Resource getPartitionResource(java.lang.String partition)
getPartitionResource in interface CapacitySchedulerPreemptionContextpublic java.util.LinkedHashSet<java.lang.String> getUnderServedQueuesPerPartition(java.lang.String partition)
getUnderServedQueuesPerPartition in interface CapacitySchedulerPreemptionContextpublic void addPartitionToUnderServedQueues(java.lang.String queueName,
java.lang.String partition)
addPartitionToUnderServedQueues in interface CapacitySchedulerPreemptionContextpublic ProportionalCapacityPreemptionPolicy.IntraQueuePreemptionOrderPolicy getIntraQueuePreemptionOrderPolicy()
getIntraQueuePreemptionOrderPolicy in interface CapacitySchedulerPreemptionContextpublic boolean getCrossQueuePreemptionConservativeDRF()
getCrossQueuePreemptionConservativeDRF in interface CapacitySchedulerPreemptionContextpublic boolean getInQueuePreemptionConservativeDRF()
getInQueuePreemptionConservativeDRF in interface CapacitySchedulerPreemptionContextpublic long getDefaultMaximumKillWaitTimeout()
getDefaultMaximumKillWaitTimeout in interface CapacitySchedulerPreemptionContextCopyright © 2008–2025 Apache Software Foundation. All rights reserved.