@InterfaceAudience.LimitedPrivate(value="yarn") @InterfaceStability.Evolving public class CapacityScheduler extends AbstractYarnScheduler implements PreemptableResourceScheduler, CapacitySchedulerContext, org.apache.hadoop.conf.Configurable
| Modifier and Type | Field and Description |
|---|---|
static String |
ROOT_QUEUE |
applications, EMPTY_ALLOCATION, EMPTY_CONTAINER_LIST, rmContext| Constructor and Description |
|---|
CapacityScheduler() |
| Modifier and Type | Method and Description |
|---|---|
Allocation |
allocate(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId,
List<org.apache.hadoop.yarn.api.records.ResourceRequest> ask,
List<org.apache.hadoop.yarn.api.records.ContainerId> release,
List<String> blacklistAdditions,
List<String> blacklistRemovals)
The main api between the ApplicationMaster and the Scheduler.
|
boolean |
checkAccess(org.apache.hadoop.security.UserGroupInformation callerUGI,
org.apache.hadoop.yarn.api.records.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.
|
FiCaSchedulerApp |
getApplicationAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId) |
Comparator<FiCaSchedulerApp> |
getApplicationComparator() |
org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport |
getAppResourceUsageReport(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId)
Get a resource usage report from a given app attempt ID.
|
List<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> |
getAppsInQueue(String queueName)
Gets the apps under a given queue
|
org.apache.hadoop.yarn.api.records.Resource |
getClusterResources() |
org.apache.hadoop.conf.Configuration |
getConf()
Get the yarn configuration.
|
CapacitySchedulerConfiguration |
getConfiguration() |
RMContainerTokenSecretManager |
getContainerTokenSecretManager() |
FiCaSchedulerApp |
getCurrentAttemptForContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId) |
org.apache.hadoop.yarn.api.records.Resource |
getMaximumResourceCapability()
Get maximum allocatable
Resource. |
org.apache.hadoop.yarn.api.records.Resource |
getMinimumResourceCapability()
Get minimum allocatable
Resource. |
SchedulerNodeReport |
getNodeReport(org.apache.hadoop.yarn.api.records.NodeId nodeId)
Get node resource usage report.
|
int |
getNumClusterNodes()
Get the number of nodes available in the cluster.
|
Comparator<CSQueue> |
getQueueComparator() |
org.apache.hadoop.yarn.api.records.QueueInfo |
getQueueInfo(String queueName,
boolean includeChildQueues,
boolean recursive)
Get queue information
|
List<org.apache.hadoop.yarn.api.records.QueueUserACLInfo> |
getQueueUserAclInfo()
Get acls for queues for current user.
|
org.apache.hadoop.yarn.util.resource.ResourceCalculator |
getResourceCalculator() |
RMContainer |
getRMContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Get the container for the given containerId.
|
RMContext |
getRMContext() |
CSQueue |
getRootQueue() |
QueueMetrics |
getRootQueueMetrics()
Get the root queue for the scheduler.
|
SchedulerAppReport |
getSchedulerAppInfo(org.apache.hadoop.yarn.api.records.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(org.apache.hadoop.yarn.api.records.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(org.apache.hadoop.conf.Configuration conf,
RMContext rmContext)
Re-initialize the
ResourceScheduler. |
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
getSchedulerApplications, getTransferredContainers, moveApplicationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmoveApplication@InterfaceAudience.Private public static final String ROOT_QUEUE
public void setConf(org.apache.hadoop.conf.Configuration conf)
setConf in interface org.apache.hadoop.conf.Configurablepublic org.apache.hadoop.conf.Configuration getConf()
CapacitySchedulerContextgetConf in interface org.apache.hadoop.conf.ConfigurablegetConf in interface CapacitySchedulerContextpublic QueueMetrics getRootQueueMetrics()
YarnSchedulergetRootQueueMetrics in interface YarnSchedulerpublic CSQueue getRootQueue()
public CapacitySchedulerConfiguration getConfiguration()
getConfiguration in interface CapacitySchedulerContextpublic RMContainerTokenSecretManager getContainerTokenSecretManager()
getContainerTokenSecretManager in interface CapacitySchedulerContextpublic org.apache.hadoop.yarn.api.records.Resource getMinimumResourceCapability()
YarnSchedulerResource.getMinimumResourceCapability in interface CapacitySchedulerContextgetMinimumResourceCapability in interface YarnSchedulerpublic org.apache.hadoop.yarn.api.records.Resource getMaximumResourceCapability()
YarnSchedulerResource.getMaximumResourceCapability in interface CapacitySchedulerContextgetMaximumResourceCapability in interface YarnSchedulerpublic Comparator<FiCaSchedulerApp> getApplicationComparator()
getApplicationComparator in interface CapacitySchedulerContextpublic org.apache.hadoop.yarn.util.resource.ResourceCalculator getResourceCalculator()
getResourceCalculator in interface CapacitySchedulerContextpublic Comparator<CSQueue> getQueueComparator()
getQueueComparator in interface CapacitySchedulerContextpublic int getNumClusterNodes()
YarnSchedulergetNumClusterNodes in interface CapacitySchedulerContextgetNumClusterNodes in interface YarnSchedulerpublic RMContext getRMContext()
getRMContext in interface CapacitySchedulerContextpublic org.apache.hadoop.yarn.api.records.Resource getClusterResources()
getClusterResources in interface CapacitySchedulerContextpublic void reinitialize(org.apache.hadoop.conf.Configuration conf,
RMContext rmContext)
throws IOException
ResourceSchedulerResourceScheduler.reinitialize in interface ResourceSchedulerconf - configurationIOException@Lock(value=org.apache.hadoop.yarn.server.utils.Lock.NoLock.class) public Allocation allocate(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId, List<org.apache.hadoop.yarn.api.records.ResourceRequest> ask, List<org.apache.hadoop.yarn.api.records.ContainerId> release, List<String> blacklistAdditions, List<String> blacklistRemovals)
YarnSchedulerallocate in interface YarnSchedulerAllocation for the application@Lock(value=org.apache.hadoop.yarn.server.utils.Lock.NoLock.class) public org.apache.hadoop.yarn.api.records.QueueInfo getQueueInfo(String queueName, boolean includeChildQueues, boolean recursive) throws IOException
YarnSchedulergetQueueInfo in interface YarnSchedulerqueueName - queue nameincludeChildQueues - include child queues?recursive - get children queues?IOException@Lock(value=org.apache.hadoop.yarn.server.utils.Lock.NoLock.class) public List<org.apache.hadoop.yarn.api.records.QueueUserACLInfo> getQueueUserAclInfo()
YarnSchedulergetQueueUserAclInfo in interface YarnSchedulerpublic void handle(SchedulerEvent event)
handle in interface org.apache.hadoop.yarn.event.EventHandler<SchedulerEvent>@Lock(value=org.apache.hadoop.yarn.server.utils.Lock.NoLock.class) public FiCaSchedulerApp getApplicationAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId)
public SchedulerAppReport getSchedulerAppInfo(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId)
YarnSchedulergetSchedulerAppInfo in interface YarnSchedulerapplicationAttemptId - the id of the application attemptpublic org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport getAppResourceUsageReport(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId)
YarnSchedulergetAppResourceUsageReport in interface YarnSchedulerapplicationAttemptId - the id of the application attemptpublic RMContainer getRMContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
YarnSchedulergetRMContainer in interface YarnSchedulerpublic FiCaSchedulerApp getCurrentAttemptForContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
@Lock(value=org.apache.hadoop.yarn.server.utils.Lock.NoLock.class) public void recover(RMStateStore.RMState state) throws Exception
recover in interface RecoverableExceptionpublic SchedulerNodeReport getNodeReport(org.apache.hadoop.yarn.api.records.NodeId nodeId)
YarnSchedulergetNodeReport in interface YarnSchedulerSchedulerNodeReport for the node or null
if nodeId does not point to a defined node.public void dropContainerReservation(RMContainer container)
PreemptableResourceSchedulerdropContainerReservation in interface PreemptableResourceSchedulercontainer - Reference to reserved container allocation.public void preemptContainer(org.apache.hadoop.yarn.api.records.ApplicationAttemptId aid,
RMContainer cont)
PreemptableResourceSchedulerpreemptContainer in interface PreemptableResourceScheduleraid - the application from which we want to get a container backcont - the container we want backpublic void killContainer(RMContainer cont)
PreemptableResourceSchedulerkillContainer in interface PreemptableResourceSchedulerpublic boolean checkAccess(org.apache.hadoop.security.UserGroupInformation callerUGI,
org.apache.hadoop.yarn.api.records.QueueACL acl,
String queueName)
YarnSchedulerQueueACL.ADMINISTER_QUEUE permission,
this user can view/modify the applications in this queuecheckAccess in interface YarnSchedulertrue if the user has the permission,
false otherwisepublic List<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> getAppsInQueue(String queueName)
YarnSchedulergetAppsInQueue in interface YarnSchedulerqueueName - the name of the queue.Copyright © 2014 Apache Software Foundation. All Rights Reserved.