public abstract class AbstractSchedulerPlanFollower extends Object implements PlanFollower
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.hadoop.yarn.util.Clock |
clock |
protected Collection<Plan> |
plans |
protected YarnScheduler |
scheduler |
| Constructor and Description |
|---|
AbstractSchedulerPlanFollower() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addReservationQueue(String planQueueName,
Queue queue,
String currResId)
Add a new reservation queue for reservation currResId for this planQueue
|
protected void |
cleanupExpiredQueues(String planQueueName,
boolean shouldMove,
Set<String> toRemove,
String defReservationQueue)
First sets entitlement of queues to zero to prevent new app submission.
|
protected abstract void |
createDefaultReservationQueue(String planQueueName,
Queue queue,
String defReservationQueue)
Creates the default reservation queue for use when no reservation is
used for applications submitted to this planQueue
|
protected abstract List<? extends Queue> |
getChildReservationQueues(Queue planQueue)
Get a list of reservation queues for this planQueue
|
protected abstract Queue |
getPlanQueue(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 String |
getReservationIdFromQueueName(String resQueueName) |
protected String |
getReservationQueueName(String planQueueName,
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,
Set<ReservationAllocation> currentReservations,
Set<String> curReservationNames,
org.apache.hadoop.yarn.api.records.Resource reservedResources) |
void |
init(org.apache.hadoop.yarn.util.Clock clock,
ResourceScheduler sched,
Collection<Plan> plans)
Init function that configures the PlanFollower, by providing:
|
void |
run() |
void |
setPlans(Collection<Plan> plans)
Setter for the list of plans.
|
protected void |
setQueueEntitlement(String planQueueName,
String currResId,
float targetCapacity,
float maxCapacity) |
protected List<ReservationAllocation> |
sortByDelta(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 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,
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 setPlans(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 void setQueueEntitlement(String planQueueName, String currResId, float targetCapacity, float maxCapacity) throws org.apache.hadoop.yarn.exceptions.YarnException
org.apache.hadoop.yarn.exceptions.YarnExceptionprotected String getReservationQueueName(String planQueueName, String reservationId)
protected void cleanupExpiredQueues(String planQueueName, boolean shouldMove, Set<String> toRemove, String defReservationQueue)
protected int getReservedResources(long now,
Set<ReservationAllocation> currentReservations,
Set<String> curReservationNames,
org.apache.hadoop.yarn.api.records.Resource reservedResources)
protected List<ReservationAllocation> sortByDelta(List<ReservationAllocation> currentReservations, long now, Plan plan)
protected abstract Queue getPlanQueue(String planQueueName)
planQueueName - Name of the reservable queueprotected abstract List<? extends Queue> getChildReservationQueues(Queue planQueue)
protected abstract void addReservationQueue(String planQueueName, Queue queue, String currResId)
protected abstract void createDefaultReservationQueue(String planQueueName, Queue queue, String defReservationQueue)
protected 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)
Copyright © 2017 Apache Software Foundation. All Rights Reserved.