@InterfaceAudience.LimitedPrivate(value="yarn") @InterfaceStability.Unstable public abstract class AbstractReservationSystem extends org.apache.hadoop.service.AbstractService implements ReservationSystem
ReservationSystem based on the
ResourceScheduler| Modifier and Type | Field and Description |
|---|---|
protected org.apache.hadoop.conf.Configuration |
conf |
protected long |
planStepSize |
| Constructor and Description |
|---|
AbstractReservationSystem(String name)
Construct the service.
|
| Modifier and Type | Method and Description |
|---|---|
protected SharingPolicy |
getAdmissionPolicy(String queueName) |
protected ReservationAgent |
getAgent(String queueName) |
Map<String,Plan> |
getAllPlans()
Return a map containing all the plans known to this ReservationSystem
(useful for UI)
|
static 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(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(String planQueueName) |
protected abstract String |
getPlanQueuePath(String planQueueName) |
String |
getQueueForReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId)
Get the
Queue that an existing ReservationId is associated
with. |
protected Planner |
getReplanner(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(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,
String queueName)
Set the
Queue that an existing ReservationId should be
associated with. |
void |
setRMContext(RMContext rmContext)
Set RMContext for
ReservationSystem. |
void |
synchronizePlan(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(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 Exception
recover in interface RecoverableExceptionpublic Plan getPlan(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(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 Exception
serviceInit in class org.apache.hadoop.service.AbstractServiceExceptionpublic void serviceStart()
throws Exception
serviceStart in class org.apache.hadoop.service.AbstractServiceExceptionpublic void serviceStop()
serviceStop in class org.apache.hadoop.service.AbstractServicepublic 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,
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 Map<String,Plan> getAllPlans()
ReservationSystemgetAllPlans in interface ReservationSystempublic static String getDefaultReservationSystem(ResourceScheduler scheduler)
scheduler - the scheduler for which the reservation system is requiredReservationSystem based on the configured schedulerprotected Plan initializePlan(String planQueueName) throws org.apache.hadoop.yarn.exceptions.YarnException
org.apache.hadoop.yarn.exceptions.YarnExceptionprotected ReservationAgent getAgent(String queueName)
protected SharingPolicy getAdmissionPolicy(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 org.apache.hadoop.yarn.api.records.Resource getPlanQueueCapacity(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 © 2022 Apache Software Foundation. All rights reserved.