java.lang.Runnable, PlanFollowerCapacitySchedulerPlanFollower, FairSchedulerPlanFollowerpublic abstract class AbstractSchedulerPlanFollower extends java.lang.Object implements PlanFollower
| Modifier and Type | Field | Description |
|---|---|---|
protected org.apache.hadoop.yarn.util.Clock |
clock |
|
protected java.util.Collection<Plan> |
plans |
|
protected YarnScheduler |
scheduler |
| Constructor | Description |
|---|---|
AbstractSchedulerPlanFollower() |
| Modifier and Type | Method | Description |
|---|---|---|
protected abstract void |
addReservationQueue(java.lang.String planQueueName,
Queue queue,
java.lang.String currResId) |
Add a new reservation queue for reservation currResId for this planQueue.
|
protected void |
cleanupExpiredQueues(java.lang.String planQueueName,
boolean shouldMove,
java.util.Set<java.lang.String> toRemove,
java.lang.String defReservationQueue) |
First sets entitlement of queues to zero to prevent new app submission.
|
protected abstract void |
createDefaultReservationQueue(java.lang.String planQueueName,
Queue queue,
java.lang.String defReservationQueue) |
Creates the default reservation queue for use when no reservation is used
for applications submitted to this planQueue.
|
protected abstract java.util.List<? extends Queue> |
getChildReservationQueues(Queue planQueue) |
Get a list of reservation queues for this planQueue.
|
protected abstract Queue |
getPlanQueue(java.lang.String planQueueName) |
Get queue associated with reservable queue named.
|
protected abstract org.apache.hadoop.yarn.api.records.Resource |
getPlanResources(Plan plan,
Queue queue,
org.apache.hadoop.yarn.api.records.Resource clusterResources) |
Get plan resources for this planQueue.
|
protected java.lang.String |
getReservationIdFromQueueName(java.lang.String resQueueName) |
|
protected java.lang.String |
getReservationQueueName(java.lang.String planQueueName,
java.lang.String reservationId) |
|
protected abstract org.apache.hadoop.yarn.api.records.Resource |
getReservationQueueResourceIfExists(Plan plan,
org.apache.hadoop.yarn.api.records.ReservationId reservationId) |
Get reservation queue resources if it exists otherwise return null.
|
protected int |
getReservedResources(long now,
java.util.Set<ReservationAllocation> currentReservations,
java.util.Set<java.lang.String> curReservationNames,
org.apache.hadoop.yarn.api.records.Resource reservedResources) |
|
void |
init(org.apache.hadoop.yarn.util.Clock clock,
ResourceScheduler sched,
java.util.Collection<Plan> plans) |
Init function that configures the PlanFollower, by providing:
|
void |
run() |
|
void |
setPlans(java.util.Collection<Plan> plans) |
Setter for the list of plans.
|
protected void |
setQueueEntitlement(java.lang.String planQueueName,
java.lang.String currResId,
float targetCapacity,
float maxCapacity) |
|
protected java.util.List<ReservationAllocation> |
sortByDelta(java.util.List<ReservationAllocation> currentReservations,
long now,
Plan plan) |
Sort in the order from the least new amount of resources asked (likely
negative) to the highest.
|
void |
synchronizePlan(Plan plan,
boolean shouldReplan) |
The function performing the actual synchronization operation for a given
Plan.
|
protected java.util.Collection<Plan> plans
protected YarnScheduler scheduler
protected org.apache.hadoop.yarn.util.Clock clock
public void init(org.apache.hadoop.yarn.util.Clock clock,
ResourceScheduler sched,
java.util.Collection<Plan> plans)
PlanFollowerinit in interface PlanFollowerclock - a reference to the system clock.sched - a reference to the underlying schedulerplans - references to the plans we should keep synchronized at every
time tick.public void run()
run in interface java.lang.Runnablepublic void setPlans(java.util.Collection<Plan> plans)
PlanFollowersetPlans in interface PlanFollowerplans - the collection of Plans we operate on at every time tick.public void synchronizePlan(Plan plan, boolean shouldReplan)
PlanFollowersynchronizePlan in interface PlanFollowerplan - the Plan to synchronizeshouldReplan - replan on reduction of plan capacity if true or
proportionally scale down reservations if falseprotected java.lang.String getReservationIdFromQueueName(java.lang.String resQueueName)
protected void setQueueEntitlement(java.lang.String planQueueName,
java.lang.String currResId,
float targetCapacity,
float maxCapacity)
throws org.apache.hadoop.yarn.exceptions.YarnException
org.apache.hadoop.yarn.exceptions.YarnExceptionprotected java.lang.String getReservationQueueName(java.lang.String planQueueName,
java.lang.String reservationId)
protected void cleanupExpiredQueues(java.lang.String planQueueName,
boolean shouldMove,
java.util.Set<java.lang.String> toRemove,
java.lang.String defReservationQueue)
planQueueName - the name of PlanQueueshouldMove - flag to indicate if any running apps should be moved or
killedtoRemove - the remnant apps to clean updefReservationQueue - the default ReservationQueue of the
Planprotected int getReservedResources(long now,
java.util.Set<ReservationAllocation> currentReservations,
java.util.Set<java.lang.String> curReservationNames,
org.apache.hadoop.yarn.api.records.Resource reservedResources)
protected java.util.List<ReservationAllocation> sortByDelta(java.util.List<ReservationAllocation> currentReservations, long now, Plan plan)
currentReservations - the currently active reservationsnow - the current timeplan - the Plan that is being consideredReservationAllocationsprotected abstract Queue getPlanQueue(java.lang.String planQueueName)
planQueueName - name of the reservable queueprotected abstract java.util.List<? extends Queue> getChildReservationQueues(Queue planQueue)
planQueue - the queue for the current Planprotected abstract void addReservationQueue(java.lang.String planQueueName,
Queue queue,
java.lang.String currResId)
planQueueName - name of the reservable queue.queue - the queue for the current Plan.currResId - curr reservationId.protected abstract void createDefaultReservationQueue(java.lang.String planQueueName,
Queue queue,
java.lang.String defReservationQueue)
planQueueName - name of the reservable queuequeue - the queue for the current PlandefReservationQueue - name of the default ReservationQueueprotected abstract org.apache.hadoop.yarn.api.records.Resource getPlanResources(Plan plan, Queue queue, org.apache.hadoop.yarn.api.records.Resource clusterResources)
protected abstract org.apache.hadoop.yarn.api.records.Resource getReservationQueueResourceIfExists(Plan plan, org.apache.hadoop.yarn.api.records.ReservationId reservationId)
plan - the current Plan being consideredreservationId - the identifier of the reservationCopyright © 2008–2025 Apache Software Foundation. All rights reserved.