public class CapacitySchedulerPlanFollower extends AbstractSchedulerPlanFollower
PlanFollower
. This is invoked on a timer, and
it is in charge to publish the state of the Plan
s 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, synchronizePlan
public void init(org.apache.hadoop.yarn.util.Clock clock, ResourceScheduler sched, Collection<Plan> plans)
PlanFollower
init
in interface PlanFollower
init
in class AbstractSchedulerPlanFollower
clock
- 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)
AbstractSchedulerPlanFollower
getPlanQueue
in class AbstractSchedulerPlanFollower
planQueueName
- Name of the reservable queueprotected List<? extends Queue> getChildReservationQueues(Queue queue)
AbstractSchedulerPlanFollower
getChildReservationQueues
in class AbstractSchedulerPlanFollower
protected void addReservationQueue(String planQueueName, Queue queue, String currResId)
AbstractSchedulerPlanFollower
addReservationQueue
in class AbstractSchedulerPlanFollower
protected void createDefaultReservationQueue(String planQueueName, Queue queue, String defReservationId)
AbstractSchedulerPlanFollower
createDefaultReservationQueue
in class AbstractSchedulerPlanFollower
protected org.apache.hadoop.yarn.api.records.Resource getPlanResources(Plan plan, Queue queue, org.apache.hadoop.yarn.api.records.Resource clusterResources)
AbstractSchedulerPlanFollower
getPlanResources
in class AbstractSchedulerPlanFollower
protected org.apache.hadoop.yarn.api.records.Resource getReservationQueueResourceIfExists(Plan plan, org.apache.hadoop.yarn.api.records.ReservationId reservationId)
AbstractSchedulerPlanFollower
getReservationQueueResourceIfExists
in class AbstractSchedulerPlanFollower
Copyright © 2017 Apache Software Foundation. All Rights Reserved.