Class FairSchedulerPlanFollower
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.reservation.AbstractSchedulerPlanFollower
org.apache.hadoop.yarn.server.resourcemanager.reservation.FairSchedulerPlanFollower
- All Implemented Interfaces:
Runnable,PlanFollower
-
Field Summary
Fields inherited from class org.apache.hadoop.yarn.server.resourcemanager.reservation.AbstractSchedulerPlanFollower
clock, plans, scheduler -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddReservationQueue(String planQueueName, Queue queue, String currResId) Add a new reservation queue for reservation currResId for this planQueue.protected voidcreateDefaultReservationQueue(String planQueueName, Queue queue, String defReservationId) Creates the default reservation queue for use when no reservation is used for applications submitted to this planQueue.getChildReservationQueues(Queue queue) Get a list of reservation queues for this planQueue.protected QueuegetPlanQueue(String planQueueName) Get queue associated with reservable queue named.protected org.apache.hadoop.yarn.api.records.ResourcegetPlanResources(Plan plan, Queue queue, org.apache.hadoop.yarn.api.records.Resource clusterResources) Get plan resources for this planQueue.protected StringgetReservationIdFromQueueName(String resQueueName) protected StringgetReservationQueueName(String planQueueName, String reservationQueueName) protected org.apache.hadoop.yarn.api.records.ResourcegetReservationQueueResourceIfExists(Plan plan, org.apache.hadoop.yarn.api.records.ReservationId reservationId) Get reservation queue resources if it exists otherwise return null.voidinit(org.apache.hadoop.yarn.util.Clock clock, ResourceScheduler sched, Collection<Plan> plans) Init function that configures the PlanFollower, by providing:Methods inherited from class org.apache.hadoop.yarn.server.resourcemanager.reservation.AbstractSchedulerPlanFollower
cleanupExpiredQueues, getReservedResources, run, setPlans, setQueueEntitlement, sortByDelta, synchronizePlan
-
Constructor Details
-
FairSchedulerPlanFollower
public FairSchedulerPlanFollower()
-
-
Method Details
-
init
public void init(org.apache.hadoop.yarn.util.Clock clock, ResourceScheduler sched, Collection<Plan> plans) Description copied from interface:PlanFollowerInit function that configures the PlanFollower, by providing:- Specified by:
initin interfacePlanFollower- Overrides:
initin classAbstractSchedulerPlanFollower- Parameters:
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.
-
getPlanQueue
Description copied from class:AbstractSchedulerPlanFollowerGet queue associated with reservable queue named.- Specified by:
getPlanQueuein classAbstractSchedulerPlanFollower- Parameters:
planQueueName- name of the reservable queue- Returns:
- queue associated with the reservable queue
-
getChildReservationQueues
Description copied from class:AbstractSchedulerPlanFollowerGet a list of reservation queues for this planQueue.- Specified by:
getChildReservationQueuesin classAbstractSchedulerPlanFollower- Parameters:
queue- the queue for the currentPlan- Returns:
- the queues corresponding to the reservations
-
addReservationQueue
Description copied from class:AbstractSchedulerPlanFollowerAdd a new reservation queue for reservation currResId for this planQueue.- Specified by:
addReservationQueuein classAbstractSchedulerPlanFollower- Parameters:
planQueueName- name of the reservable queue.queue- the queue for the currentPlan.currResId- curr reservationId.
-
createDefaultReservationQueue
protected void createDefaultReservationQueue(String planQueueName, Queue queue, String defReservationId) Description copied from class:AbstractSchedulerPlanFollowerCreates the default reservation queue for use when no reservation is used for applications submitted to this planQueue.- Specified by:
createDefaultReservationQueuein classAbstractSchedulerPlanFollower- Parameters:
planQueueName- name of the reservable queuequeue- the queue for the currentPlandefReservationId- name of the defaultReservationQueue
-
getPlanResources
protected org.apache.hadoop.yarn.api.records.Resource getPlanResources(Plan plan, Queue queue, org.apache.hadoop.yarn.api.records.Resource clusterResources) Description copied from class:AbstractSchedulerPlanFollowerGet plan resources for this planQueue.- Specified by:
getPlanResourcesin classAbstractSchedulerPlanFollower- Parameters:
plan- the currentPlanbeing consideredqueue- the queue for the currentPlanclusterResources- the resources available in the cluster- Returns:
- the resources allocated to the specified
Plan
-
getReservationQueueResourceIfExists
protected org.apache.hadoop.yarn.api.records.Resource getReservationQueueResourceIfExists(Plan plan, org.apache.hadoop.yarn.api.records.ReservationId reservationId) Description copied from class:AbstractSchedulerPlanFollowerGet reservation queue resources if it exists otherwise return null.- Specified by:
getReservationQueueResourceIfExistsin classAbstractSchedulerPlanFollower- Parameters:
plan- the currentPlanbeing consideredreservationId- the identifier of the reservation- Returns:
- the resources allocated to the specified reservation
-
getReservationQueueName
- Overrides:
getReservationQueueNamein classAbstractSchedulerPlanFollower
-
getReservationIdFromQueueName
- Overrides:
getReservationIdFromQueueNamein classAbstractSchedulerPlanFollower
-