java.io.Closeable, java.lang.AutoCloseable, org.apache.hadoop.service.Service, Recoverable, ReservationSystemCapacityReservationSystem, FairReservationSystem@LimitedPrivate("yarn")
@Unstable
public abstract class AbstractReservationSystem
extends org.apache.hadoop.service.AbstractService
implements ReservationSystem
ReservationSystem based on the
ResourceScheduler| Modifier and Type | Field | Description |
|---|---|---|
protected org.apache.hadoop.conf.Configuration |
conf |
|
protected long |
planStepSize |
| Constructor | Description |
|---|---|
AbstractReservationSystem(java.lang.String name) |
Construct the service.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected SharingPolicy |
getAdmissionPolicy(java.lang.String queueName) |
|
protected ReservationAgent |
getAgent(java.lang.String queueName) |
|
java.util.Map<java.lang.String,Plan> |
getAllPlans() |
Return a map containing all the plans known to this ReservationSystem
(useful for UI)
|
static java.lang.String |
getDefaultReservationSystem(ResourceScheduler scheduler) |
Get the default reservation system corresponding to the scheduler
|
protected abstract org.apache.hadoop.yarn.api.records.Resource |
getMaxAllocation() |
|
protected abstract org.apache.hadoop.yarn.api.records.Resource |
getMinAllocation() |
|
org.apache.hadoop.yarn.api.records.ReservationId |
getNewReservationId() |
Get a new unique
ReservationId. |
Plan |
getPlan(java.lang.String planName) |
Get an existing
Plan that has been initialized. |
long |
getPlanFollowerTimeStep() |
Return the time step (ms) at which the
PlanFollower is invoked |
protected abstract org.apache.hadoop.yarn.api.records.Resource |
getPlanQueueCapacity(java.lang.String planQueueName) |
|
protected abstract java.lang.String |
getPlanQueuePath(java.lang.String planQueueName) |
|
java.lang.String |
getQueueForReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId) |
Get the
Queue that an existing ReservationId is associated
with. |
protected Planner |
getReplanner(java.lang.String planQueueName) |
|
ReservationsACLsManager |
getReservationsACLsManager() |
Get the
ReservationsACLsManager to use to check for the reservation
access on a user. |
protected abstract ReservationSchedulerConfiguration |
getReservationSchedulerConfiguration() |
|
protected abstract org.apache.hadoop.yarn.util.resource.ResourceCalculator |
getResourceCalculator() |
|
protected abstract QueueMetrics |
getRootQueueMetrics() |
|
protected Plan |
initializePlan(java.lang.String planQueueName) |
|
void |
recover(RMStateStore.RMState state) |
|
void |
reinitialize(org.apache.hadoop.conf.Configuration conf,
RMContext rmContext) |
Re-initialize the
ReservationSystem. |
void |
serviceInit(org.apache.hadoop.conf.Configuration conf) |
|
void |
serviceStart() |
|
void |
serviceStop() |
|
void |
setQueueForReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId,
java.lang.String queueName) |
Set the
Queue that an existing ReservationId should be
associated with. |
void |
setRMContext(RMContext rmContext) |
Set RMContext for
ReservationSystem. |
void |
synchronizePlan(java.lang.String planName,
boolean shouldReplan) |
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStopprotected org.apache.hadoop.conf.Configuration conf
protected long planStepSize
public AbstractReservationSystem(java.lang.String name)
name - service namepublic void setRMContext(RMContext rmContext)
ReservationSystemReservationSystem. This method should be called
immediately after instantiating a reservation system once.setRMContext in interface ReservationSystemrmContext - created by ResourceManagerpublic void reinitialize(org.apache.hadoop.conf.Configuration conf,
RMContext rmContext)
throws org.apache.hadoop.yarn.exceptions.YarnException
ReservationSystemReservationSystem.reinitialize in interface ReservationSystemconf - configurationrmContext - current context of the ResourceManagerorg.apache.hadoop.yarn.exceptions.YarnException - if initialization of the configured plan failspublic void recover(RMStateStore.RMState state) throws java.lang.Exception
recover in interface Recoverablejava.lang.Exceptionpublic Plan getPlan(java.lang.String planName)
ReservationSystemPlan that has been initialized.getPlan in interface ReservationSystemplanName - the name of the PlanPlan identified by namepublic long getPlanFollowerTimeStep()
ReservationSystemPlanFollower is invokedgetPlanFollowerTimeStep in interface ReservationSystempublic void synchronizePlan(java.lang.String planName,
boolean shouldReplan)
ReservationSystemsynchronizePlan in interface ReservationSystemplanName - the name of the Plan to be synchronizedshouldReplan - replan on reduction of plan capacity if true or
proportionally scale down reservations if falsepublic void serviceInit(org.apache.hadoop.conf.Configuration conf)
throws java.lang.Exception
serviceInit in class org.apache.hadoop.service.AbstractServicejava.lang.Exceptionpublic void serviceStart()
throws java.lang.Exception
serviceStart in class org.apache.hadoop.service.AbstractServicejava.lang.Exceptionpublic void serviceStop()
serviceStop in class org.apache.hadoop.service.AbstractServicepublic java.lang.String getQueueForReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId)
ReservationSystemQueue that an existing ReservationId is associated
with.getQueueForReservation in interface ReservationSystemreservationId - the unique id of the reservationpublic void setQueueForReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId,
java.lang.String queueName)
ReservationSystemQueue that an existing ReservationId should be
associated with.setQueueForReservation in interface ReservationSystemreservationId - the unique id of the reservationqueueName - the name of Queue to associate the reservation withpublic org.apache.hadoop.yarn.api.records.ReservationId getNewReservationId()
ReservationSystemReservationId.getNewReservationId in interface ReservationSystemReservationIdpublic java.util.Map<java.lang.String,Plan> getAllPlans()
ReservationSystemgetAllPlans in interface ReservationSystempublic static java.lang.String getDefaultReservationSystem(ResourceScheduler scheduler)
scheduler - the scheduler for which the reservation system is requiredReservationSystem based on the configured schedulerprotected Plan initializePlan(java.lang.String planQueueName) throws org.apache.hadoop.yarn.exceptions.YarnException
org.apache.hadoop.yarn.exceptions.YarnExceptionprotected Planner getReplanner(java.lang.String planQueueName)
protected ReservationAgent getAgent(java.lang.String queueName)
protected SharingPolicy getAdmissionPolicy(java.lang.String queueName)
public ReservationsACLsManager getReservationsACLsManager()
ReservationSystemReservationsACLsManager to use to check for the reservation
access on a user.getReservationsACLsManager in interface ReservationSystemprotected abstract ReservationSchedulerConfiguration getReservationSchedulerConfiguration()
protected abstract java.lang.String getPlanQueuePath(java.lang.String planQueueName)
protected abstract org.apache.hadoop.yarn.api.records.Resource getPlanQueueCapacity(java.lang.String planQueueName)
protected abstract org.apache.hadoop.yarn.api.records.Resource getMinAllocation()
protected abstract org.apache.hadoop.yarn.api.records.Resource getMaxAllocation()
protected abstract org.apache.hadoop.yarn.util.resource.ResourceCalculator getResourceCalculator()
protected abstract QueueMetrics getRootQueueMetrics()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.