public class CapacitySchedulerPlanFollower extends Object implements PlanFollower
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).| Constructor and Description |
|---|
CapacitySchedulerPlanFollower() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
synchronizePlan(Plan plan)
The function performing the actual synchronization operation for a given
Plan.
|
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 synchronizePlan(Plan plan)
PlanFollowersynchronizePlan in interface PlanFollowerplan - the Plan to synchronizepublic void setPlans(Collection<Plan> plans)
PlanFollowersetPlans in interface PlanFollowerplans - the collection of Plans we operate on at every time tick.Copyright © 2015 Apache Software Foundation. All Rights Reserved.