Interface ReservationSystem
- All Superinterfaces:
Recoverable
- All Known Implementing Classes:
AbstractReservationSystem,CapacityReservationSystem,FairReservationSystem
This interface is the one implemented by any system that wants to support
Reservations i.e. make
Resource allocations in future. Implementors
need to bootstrap all configured Plans in the active
ResourceScheduler along with their corresponding
ReservationAgent and SharingPolicy. It is also responsible
for managing the PlanFollower to ensure the Plans are in sync
with the ResourceScheduler.-
Method Summary
Modifier and TypeMethodDescriptionReturn a map containing all the plans known to this ReservationSystem (useful for UI)org.apache.hadoop.yarn.api.records.ReservationIdGet a new uniqueReservationId.Get an existingPlanthat has been initialized.longReturn the time step (ms) at which thePlanFolloweris invokedgetQueueForReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId) Get theQueuethat an existingReservationIdis associated with.Get theReservationsACLsManagerto use to check for the reservation access on a user.voidreinitialize(org.apache.hadoop.conf.Configuration conf, RMContext rmContext) Re-initialize theReservationSystem.voidsetQueueForReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId, String queueName) Set theQueuethat an existingReservationIdshould be associated with.voidsetRMContext(RMContext rmContext) Set RMContext forReservationSystem.voidsynchronizePlan(String planName, boolean shouldReplan) Methods inherited from interface org.apache.hadoop.yarn.server.resourcemanager.recovery.Recoverable
recover
-
Method Details
-
setRMContext
Set RMContext forReservationSystem. This method should be called immediately after instantiating a reservation system once.- Parameters:
rmContext- created byResourceManager
-
reinitialize
void reinitialize(org.apache.hadoop.conf.Configuration conf, RMContext rmContext) throws org.apache.hadoop.yarn.exceptions.YarnException Re-initialize theReservationSystem.- Parameters:
conf- configurationrmContext- current context of theResourceManager- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if initialization of the configured plan fails
-
getPlan
Get an existingPlanthat has been initialized. -
getAllPlans
Return a map containing all the plans known to this ReservationSystem (useful for UI)- Returns:
- a Map of Plan names and Plan objects
-
synchronizePlan
- Parameters:
planName- the name of thePlanto be synchronizedshouldReplan- replan on reduction of plan capacity if true or proportionally scale down reservations if false
-
getPlanFollowerTimeStep
long getPlanFollowerTimeStep()Return the time step (ms) at which thePlanFolloweris invoked- Returns:
- the time step (ms) at which the
PlanFolloweris invoked
-
getNewReservationId
org.apache.hadoop.yarn.api.records.ReservationId getNewReservationId()Get a new uniqueReservationId.- Returns:
- a new unique
ReservationId
-
getQueueForReservation
Get theQueuethat an existingReservationIdis associated with.- Parameters:
reservationId- the unique id of the reservation- Returns:
- the name of the associated Queue
-
setQueueForReservation
void setQueueForReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId, String queueName) Set theQueuethat an existingReservationIdshould be associated with.- Parameters:
reservationId- the unique id of the reservationqueueName- the name of Queue to associate the reservation with
-
getReservationsACLsManager
ReservationsACLsManager getReservationsACLsManager()Get theReservationsACLsManagerto use to check for the reservation access on a user.- Returns:
- the reservation ACL manager to use to check reservation ACLs.
-