public class CapacitySchedulerPlanFollower extends AbstractSchedulerPlanFollower
PlanFollower. This is invoked on a timer, and
it is in charge to publish the state of the Plans to the underlying
CapacityScheduler. This implementation does so, by
adding/removing/resizing leaf queues in the scheduler, thus affecting the
dynamic behavior of the scheduler in a way that is consistent with the
content of the plan. It also updates the plan's view on how much resources
are available in the cluster.
This implementation of PlanFollower is relatively stateless, and it can
synchronize schedulers and Plans that have arbitrary changes (performing set
differences among existing queues). This makes it resilient to frequency of
synchronization, and RM restart issues (no "catch up" is necessary).clock, plans, scheduler| Constructor and Description |
|---|
CapacitySchedulerPlanFollower() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addReservationQueue(String planQueueName,
Queue queue,
String currResId)
Add a new reservation queue for reservation currResId for this planQueue.
|
protected void |
createDefaultReservationQueue(String planQueueName,
Queue queue,
String defReservationId)
Creates the default reservation queue for use when no reservation is used
for applications submitted to this planQueue.
|
protected List<? extends Queue> |
getChildReservationQueues(Queue queue)
Get a list of reservation queues for this planQueue.
|
protected Queue |
getPlanQueue(String planQueueName)
Get queue associated with reservable queue named.
|
protected 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 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.
|
void |
init(org.apache.hadoop.yarn.util.Clock clock,
ResourceScheduler sched,
Collection<Plan> plans)
Init function that configures the PlanFollower, by providing:
|
cleanupExpiredQueues, getReservationIdFromQueueName, getReservationQueueName, getReservedResources, run, setPlans, setQueueEntitlement, sortByDelta, synchronizePlanpublic void init(org.apache.hadoop.yarn.util.Clock clock,
ResourceScheduler sched,
Collection<Plan> plans)
PlanFollowerinit in interface PlanFollowerinit in class AbstractSchedulerPlanFollowerclock - 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.protected Queue getPlanQueue(String planQueueName)
AbstractSchedulerPlanFollowergetPlanQueue in class AbstractSchedulerPlanFollowerplanQueueName - name of the reservable queueprotected List<? extends Queue> getChildReservationQueues(Queue queue)
AbstractSchedulerPlanFollowergetChildReservationQueues in class AbstractSchedulerPlanFollowerqueue - the queue for the current Planprotected void addReservationQueue(String planQueueName, Queue queue, String currResId)
AbstractSchedulerPlanFolloweraddReservationQueue in class AbstractSchedulerPlanFollowerprotected void createDefaultReservationQueue(String planQueueName, Queue queue, String defReservationId)
AbstractSchedulerPlanFollowercreateDefaultReservationQueue in class AbstractSchedulerPlanFollowerplanQueueName - name of the reservable queuequeue - the queue for the current PlandefReservationId - name of the default ReservationQueueprotected org.apache.hadoop.yarn.api.records.Resource getPlanResources(Plan plan, Queue queue, org.apache.hadoop.yarn.api.records.Resource clusterResources)
AbstractSchedulerPlanFollowergetPlanResources in class AbstractSchedulerPlanFollowerplan - the current Plan being consideredclusterResources - the resources available in the clusterPlanprotected org.apache.hadoop.yarn.api.records.Resource getReservationQueueResourceIfExists(Plan plan, org.apache.hadoop.yarn.api.records.ReservationId reservationId)
AbstractSchedulerPlanFollowergetReservationQueueResourceIfExists in class AbstractSchedulerPlanFollowerplan - the current Plan being consideredreservationId - the identifier of the reservationCopyright © 2008–2022 Apache Software Foundation. All rights reserved.