|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.ProportionalCapacityPreemptionPolicy
public class ProportionalCapacityPreemptionPolicy
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
).
Field Summary | |
---|---|
org.apache.hadoop.yarn.event.EventHandler<ContainerPreemptEvent> |
dispatcher
|
static String |
MAX_IGNORED_OVER_CAPACITY
Maximum amount of resources above the target capacity ignored for preemption. |
static String |
MONITORING_INTERVAL
Time in milliseconds between invocations of this policy |
static String |
NATURAL_TERMINATION_FACTOR
Given a computed preemption target, account for containers naturally expiring and preempt only this percentage of the delta. |
static String |
OBSERVE_ONLY
If true, run the policy but do not affect the cluster with preemption and kill events. |
static String |
TOTAL_PREEMPTION_PER_ROUND
Maximum percentage of resources preempted in a single round. |
static String |
WAIT_TIME_BEFORE_KILL
Time in milliseconds between requesting a preemption from an application and killing the container. |
Constructor Summary | |
---|---|
ProportionalCapacityPreemptionPolicy()
|
|
ProportionalCapacityPreemptionPolicy(org.apache.hadoop.conf.Configuration config,
org.apache.hadoop.yarn.event.EventHandler<ContainerPreemptEvent> dispatcher,
CapacityScheduler scheduler)
|
|
ProportionalCapacityPreemptionPolicy(org.apache.hadoop.conf.Configuration config,
org.apache.hadoop.yarn.event.EventHandler<ContainerPreemptEvent> dispatcher,
CapacityScheduler scheduler,
org.apache.hadoop.yarn.util.Clock clock)
|
Method Summary | |
---|---|
void |
editSchedule()
This method is invoked at regular intervals. |
long |
getMonitoringInterval()
|
String |
getPolicyName()
|
void |
init(org.apache.hadoop.conf.Configuration config,
org.apache.hadoop.yarn.event.EventHandler<ContainerPreemptEvent> disp,
PreemptableResourceScheduler sched)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String OBSERVE_ONLY
public static final String MONITORING_INTERVAL
public static final String WAIT_TIME_BEFORE_KILL
public static final String TOTAL_PREEMPTION_PER_ROUND
public static final String MAX_IGNORED_OVER_CAPACITY
public static final String NATURAL_TERMINATION_FACTOR
MAX_IGNORED_OVER_CAPACITY
). For example, a termination factor of 0.5
will reclaim almost 95% of resources within 5 * WAIT_TIME_BEFORE_KILL
, even absent natural termination.
public org.apache.hadoop.yarn.event.EventHandler<ContainerPreemptEvent> dispatcher
Constructor Detail |
---|
public ProportionalCapacityPreemptionPolicy()
public ProportionalCapacityPreemptionPolicy(org.apache.hadoop.conf.Configuration config, org.apache.hadoop.yarn.event.EventHandler<ContainerPreemptEvent> dispatcher, CapacityScheduler scheduler)
public ProportionalCapacityPreemptionPolicy(org.apache.hadoop.conf.Configuration config, org.apache.hadoop.yarn.event.EventHandler<ContainerPreemptEvent> dispatcher, CapacityScheduler scheduler, org.apache.hadoop.yarn.util.Clock clock)
Method Detail |
---|
public void init(org.apache.hadoop.conf.Configuration config, org.apache.hadoop.yarn.event.EventHandler<ContainerPreemptEvent> disp, PreemptableResourceScheduler sched)
init
in interface SchedulingEditPolicy
public void editSchedule()
SchedulingEditPolicy
editSchedule
in interface SchedulingEditPolicy
public long getMonitoringInterval()
getMonitoringInterval
in interface SchedulingEditPolicy
public String getPolicyName()
getPolicyName
in interface SchedulingEditPolicy
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |