@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, waitForServiceToStop
protected org.apache.hadoop.conf.Configuration conf
protected long planStepSize
public AbstractReservationSystem(String name)
name
- service namepublic void setRMContext(RMContext rmContext)
ReservationSystem
ReservationSystem
. This method should be called
immediately after instantiating a reservation system once.setRMContext
in interface ReservationSystem
rmContext
- created by ResourceManager
public void reinitialize(org.apache.hadoop.conf.Configuration conf, RMContext rmContext) throws org.apache.hadoop.yarn.exceptions.YarnException
ReservationSystem
ReservationSystem
.reinitialize
in interface ReservationSystem
conf
- configurationrmContext
- current context of the ResourceManager
org.apache.hadoop.yarn.exceptions.YarnException
- if initialization of the configured plan failspublic void recover(RMStateStore.RMState state) throws Exception
recover
in interface Recoverable
Exception
public Plan getPlan(String planName)
ReservationSystem
Plan
that has been initialized.getPlan
in interface ReservationSystem
planName
- the name of the Plan
Plan
identified by namepublic long getPlanFollowerTimeStep()
ReservationSystem
PlanFollower
is invokedgetPlanFollowerTimeStep
in interface ReservationSystem
public void synchronizePlan(String planName, boolean shouldReplan)
ReservationSystem
synchronizePlan
in interface ReservationSystem
planName
- 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.AbstractService
Exception
public void serviceStart() throws Exception
serviceStart
in class org.apache.hadoop.service.AbstractService
Exception
public void serviceStop()
serviceStop
in class org.apache.hadoop.service.AbstractService
public String getQueueForReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId)
ReservationSystem
Queue
that an existing ReservationId
is associated
with.getQueueForReservation
in interface ReservationSystem
reservationId
- the unique id of the reservationpublic void setQueueForReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId, String queueName)
ReservationSystem
Queue
that an existing ReservationId
should be
associated with.setQueueForReservation
in interface ReservationSystem
reservationId
- the unique id of the reservationqueueName
- the name of Queue to associate the reservation withpublic org.apache.hadoop.yarn.api.records.ReservationId getNewReservationId()
ReservationSystem
ReservationId
.getNewReservationId
in interface ReservationSystem
ReservationId
public Map<String,Plan> getAllPlans()
ReservationSystem
getAllPlans
in interface ReservationSystem
public 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.YarnException
protected ReservationAgent getAgent(String queueName)
protected SharingPolicy getAdmissionPolicy(String queueName)
public ReservationsACLsManager getReservationsACLsManager()
ReservationSystem
ReservationsACLsManager
to use to check for the reservation
access on a user.getReservationsACLsManager
in interface ReservationSystem
protected 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 © 2008–2022 Apache Software Foundation. All rights reserved.