org.apache.hadoop.yarn.server.resourcemanager.reservation
Class CapacitySchedulerPlanFollower

java.lang.Object
  extended by org.apache.hadoop.yarn.server.resourcemanager.reservation.CapacitySchedulerPlanFollower
All Implemented Interfaces:
Runnable, PlanFollower

public class CapacitySchedulerPlanFollower
extends Object
implements PlanFollower

This class implements a 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 Summary
CapacitySchedulerPlanFollower()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CapacitySchedulerPlanFollower

public CapacitySchedulerPlanFollower()
Method Detail

init

public void init(org.apache.hadoop.yarn.util.Clock clock,
                 ResourceScheduler sched,
                 Collection<Plan> plans)
Description copied from interface: PlanFollower
Init function that configures the PlanFollower, by providing:

Specified by:
init in interface PlanFollower
Parameters:
clock - a reference to the system clock.
sched - a reference to the underlying scheduler
plans - references to the plans we should keep synchronized at every time tick.

run

public void run()
Specified by:
run in interface Runnable

synchronizePlan

public void synchronizePlan(Plan plan)
Description copied from interface: PlanFollower
The function performing the actual synchronization operation for a given Plan. This is normally invoked by the run method, but it can be invoked synchronously to avoid race conditions when a user's reservation request start time is imminent.

Specified by:
synchronizePlan in interface PlanFollower
Parameters:
plan - the Plan to synchronize

setPlans

public void setPlans(Collection<Plan> plans)
Description copied from interface: PlanFollower
Setter for the list of plans.

Specified by:
setPlans in interface PlanFollower
Parameters:
plans - the collection of Plans we operate on at every time tick.


Copyright © 2014 Apache Software Foundation. All Rights Reserved.