Class ProportionalCapacityPreemptionPolicy

java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.ProportionalCapacityPreemptionPolicy
All Implemented Interfaces:
CapacitySchedulerPreemptionContext, SchedulingEditPolicy

public class ProportionalCapacityPreemptionPolicy extends Object implements SchedulingEditPolicy, CapacitySchedulerPreemptionContext
This class implement a 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).