@InterfaceAudience.LimitedPrivate(value="yarn") @InterfaceStability.Evolving public class CapacityScheduler extends Object implements PreemptableResourceScheduler, CapacitySchedulerContext, Configurable
Modifier and Type | Field and Description |
---|---|
protected Map<ApplicationAttemptId,FiCaSchedulerApp> |
applications |
static String |
ROOT_QUEUE |
Constructor and Description |
---|
CapacityScheduler() |
Modifier and Type | Method and Description |
---|---|
Allocation |
allocate(ApplicationAttemptId applicationAttemptId,
List<ResourceRequest> ask,
List<ContainerId> release,
List<String> blacklistAdditions,
List<String> blacklistRemovals)
The main api between the ApplicationMaster and the Scheduler.
|
boolean |
checkAccess(UserGroupInformation callerUGI,
QueueACL acl,
String queueName)
Check if the user has permission to perform the operation.
|
void |
dropContainerReservation(RMContainer container)
If the scheduler support container reservations, this method is used to
ask the scheduler to drop the reservation for the given container.
|
Comparator<FiCaSchedulerApp> |
getApplicationComparator() |
Resource |
getClusterResources() |
Configuration |
getConf()
Get the yarn configuration.
|
CapacitySchedulerConfiguration |
getConfiguration() |
RMContainerTokenSecretManager |
getContainerTokenSecretManager() |
Resource |
getMaximumResourceCapability()
Get maximum allocatable
Resource . |
Resource |
getMinimumResourceCapability()
Get minimum allocatable
Resource . |
SchedulerNodeReport |
getNodeReport(NodeId nodeId)
Get node resource usage report.
|
int |
getNumClusterNodes()
Get the number of nodes available in the cluster.
|
Comparator<CSQueue> |
getQueueComparator() |
QueueInfo |
getQueueInfo(String queueName,
boolean includeChildQueues,
boolean recursive)
Get queue information
|
List<QueueUserACLInfo> |
getQueueUserAclInfo()
Get acls for queues for current user.
|
ResourceCalculator |
getResourceCalculator() |
RMContext |
getRMContext() |
CSQueue |
getRootQueue() |
QueueMetrics |
getRootQueueMetrics()
Get the root queue for the scheduler.
|
SchedulerAppReport |
getSchedulerAppInfo(ApplicationAttemptId applicationAttemptId)
Get the Scheduler app for a given app attempt Id.
|
void |
handle(SchedulerEvent event) |
void |
killContainer(RMContainer cont)
Ask the scheduler to forcibly interrupt the container given as input
|
void |
preemptContainer(ApplicationAttemptId aid,
RMContainer cont)
Ask the scheduler to obtain back the container from a specific application
by issuing a preemption request
|
void |
recover(RMStateStore.RMState state) |
void |
reinitialize(Configuration conf,
RMContext rmContext)
Re-initialize the
ResourceScheduler . |
void |
setConf(Configuration conf)
Set the configuration to be used by this object.
|
protected Map<ApplicationAttemptId,FiCaSchedulerApp> applications
@InterfaceAudience.Private public static final String ROOT_QUEUE
public void setConf(Configuration conf)
Configurable
setConf
in interface Configurable
public Configuration getConf()
CapacitySchedulerContext
getConf
in interface Configurable
getConf
in interface CapacitySchedulerContext
public QueueMetrics getRootQueueMetrics()
YarnScheduler
getRootQueueMetrics
in interface YarnScheduler
public CSQueue getRootQueue()
public CapacitySchedulerConfiguration getConfiguration()
getConfiguration
in interface CapacitySchedulerContext
public RMContainerTokenSecretManager getContainerTokenSecretManager()
getContainerTokenSecretManager
in interface CapacitySchedulerContext
public Resource getMinimumResourceCapability()
YarnScheduler
Resource
.getMinimumResourceCapability
in interface CapacitySchedulerContext
getMinimumResourceCapability
in interface YarnScheduler
public Resource getMaximumResourceCapability()
YarnScheduler
Resource
.getMaximumResourceCapability
in interface CapacitySchedulerContext
getMaximumResourceCapability
in interface YarnScheduler
public Comparator<FiCaSchedulerApp> getApplicationComparator()
getApplicationComparator
in interface CapacitySchedulerContext
public ResourceCalculator getResourceCalculator()
getResourceCalculator
in interface CapacitySchedulerContext
public Comparator<CSQueue> getQueueComparator()
getQueueComparator
in interface CapacitySchedulerContext
public int getNumClusterNodes()
YarnScheduler
getNumClusterNodes
in interface CapacitySchedulerContext
getNumClusterNodes
in interface YarnScheduler
public RMContext getRMContext()
getRMContext
in interface CapacitySchedulerContext
public Resource getClusterResources()
getClusterResources
in interface CapacitySchedulerContext
public void reinitialize(Configuration conf, RMContext rmContext) throws IOException
ResourceScheduler
ResourceScheduler
.reinitialize
in interface ResourceScheduler
conf
- configurationIOException
@Lock(value=Lock.NoLock.class) public Allocation allocate(ApplicationAttemptId applicationAttemptId, List<ResourceRequest> ask, List<ContainerId> release, List<String> blacklistAdditions, List<String> blacklistRemovals)
YarnScheduler
allocate
in interface YarnScheduler
Allocation
for the application@Lock(value=Lock.NoLock.class) public QueueInfo getQueueInfo(String queueName, boolean includeChildQueues, boolean recursive) throws IOException
YarnScheduler
getQueueInfo
in interface YarnScheduler
queueName
- queue nameincludeChildQueues
- include child queues?recursive
- get children queues?IOException
@Lock(value=Lock.NoLock.class) public List<QueueUserACLInfo> getQueueUserAclInfo()
YarnScheduler
getQueueUserAclInfo
in interface YarnScheduler
public void handle(SchedulerEvent event)
handle
in interface EventHandler<SchedulerEvent>
public SchedulerAppReport getSchedulerAppInfo(ApplicationAttemptId applicationAttemptId)
YarnScheduler
getSchedulerAppInfo
in interface YarnScheduler
applicationAttemptId
- the id of the application attempt@Lock(value=Lock.NoLock.class) public void recover(RMStateStore.RMState state) throws Exception
recover
in interface Recoverable
Exception
public SchedulerNodeReport getNodeReport(NodeId nodeId)
YarnScheduler
getNodeReport
in interface YarnScheduler
SchedulerNodeReport
for the node or null
if nodeId does not point to a defined node.public void dropContainerReservation(RMContainer container)
PreemptableResourceScheduler
dropContainerReservation
in interface PreemptableResourceScheduler
container
- Reference to reserved container allocation.public void preemptContainer(ApplicationAttemptId aid, RMContainer cont)
PreemptableResourceScheduler
preemptContainer
in interface PreemptableResourceScheduler
aid
- the application from which we want to get a container backcont
- the container we want backpublic void killContainer(RMContainer cont)
PreemptableResourceScheduler
killContainer
in interface PreemptableResourceScheduler
public boolean checkAccess(UserGroupInformation callerUGI, QueueACL acl, String queueName)
YarnScheduler
QueueACL.ADMINISTER_QUEUE
permission,
this user can view/modify the applications in this queuecheckAccess
in interface YarnScheduler
true
if the user has the permission,
false
otherwiseCopyright © 2013 Apache Software Foundation. All rights reserved.