org.apache.hadoop.yarn.event.EventHandler<SchedulerEvent>MutableConfScheduler, PreemptableResourceScheduler, ResourceSchedulerAbstractYarnScheduler, CapacityScheduler, FairScheduler, FifoSchedulerpublic interface YarnScheduler extends org.apache.hadoop.yarn.event.EventHandler<SchedulerEvent>
| Modifier and Type | Method | Description |
|---|---|---|
void |
addQueue(Queue newQueue) |
Add to the scheduler a new Queue.
|
Allocation |
allocate(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId,
java.util.List<org.apache.hadoop.yarn.api.records.ResourceRequest> ask,
java.util.List<org.apache.hadoop.yarn.api.records.SchedulingRequest> schedulingRequests,
java.util.List<org.apache.hadoop.yarn.api.records.ContainerId> release,
java.util.List<java.lang.String> blacklistAdditions,
java.util.List<java.lang.String> blacklistRemovals,
ContainerUpdates updateRequests) |
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,
java.lang.String queueName) |
Check if the user has permission to perform the operation.
|
long |
checkAndGetApplicationLifetime(java.lang.String queueName,
long lifetime) |
Verify whether a submitted application lifetime is valid as per configured
Queue lifetime.
|
org.apache.hadoop.yarn.api.records.Priority |
checkAndGetApplicationPriority(org.apache.hadoop.yarn.api.records.Priority priorityRequestedByApp,
org.apache.hadoop.security.UserGroupInformation user,
java.lang.String queuePath,
org.apache.hadoop.yarn.api.records.ApplicationId applicationId) |
Verify whether a submitted application priority is valid as per configured
Queue
|
org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport |
getAppResourceUsageReport(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId) |
Get a resource usage report from a given app attempt ID.
|
java.util.List<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> |
getAppsInQueue(java.lang.String queueName) |
Gets the apps under a given queue
|
org.apache.hadoop.yarn.api.records.Resource |
getClusterResource() |
Get the whole resource capacity of the cluster.
|
org.apache.hadoop.yarn.api.records.Priority |
getMaxClusterLevelAppPriority() |
Get cluster max priority.
|
long |
getMaximumApplicationLifetime(java.lang.String queueName) |
Get maximum lifetime for a queue.
|
org.apache.hadoop.yarn.api.records.Resource |
getMaximumResourceCapability() |
Get maximum allocatable
Resource at the cluster level. |
org.apache.hadoop.yarn.api.records.Resource |
getMaximumResourceCapability(java.lang.String queueName) |
Get maximum allocatable
Resource for the queue specified. |
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.
|
org.apache.hadoop.yarn.api.records.Resource |
getNormalizedResource(org.apache.hadoop.yarn.api.records.Resource requestedResource,
org.apache.hadoop.yarn.api.records.Resource maxResourceCapability) |
Normalize a resource request using scheduler level maximum resource or
queue based maximum resource.
|
int |
getNumClusterNodes() |
Get the number of nodes available in the cluster.
|
java.util.List<org.apache.hadoop.yarn.api.records.ResourceRequest> |
getPendingResourceRequestsForAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId) |
Get pending resource request for specified application attempt.
|
java.util.List<org.apache.hadoop.yarn.api.records.SchedulingRequest> |
getPendingSchedulingRequestsForAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId) |
Get pending scheduling request for specified application attempt.
|
java.util.Set<java.lang.String> |
getPlanQueues() |
Gets the list of names for queues managed by the Reservation System.
|
org.apache.hadoop.yarn.api.records.QueueInfo |
getQueueInfo(java.lang.String queueName,
boolean includeChildQueues,
boolean recursive) |
Get queue information.
|
java.util.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.
|
QueueMetrics |
getRootQueueMetrics() |
Get the root queue for the scheduler.
|
SchedulerAppReport |
getSchedulerAppInfo(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId) |
Get the Scheduler app for a given app attempt Id.
|
SchedulerNode |
getSchedulerNode(org.apache.hadoop.yarn.api.records.NodeId nodeId) |
Get SchedulerNode corresponds to nodeId.
|
java.util.EnumSet<org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes> |
getSchedulingResourceTypes() |
Return a collection of the resource types that are considered when
scheduling
|
java.util.List<org.apache.hadoop.yarn.api.records.Container> |
getTransferredContainers(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId) |
Get previous attempts' live containers for work-preserving AM restart.
|
void |
killAllAppsInQueue(java.lang.String queueName) |
Terminate all applications in the specified queue.
|
void |
moveAllApps(java.lang.String sourceQueue,
java.lang.String destQueue) |
Completely drain sourceQueue of applications, by moving all of them to
destQueue.
|
java.lang.String |
moveApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String newQueue) |
Moves the given application to the given queue.
|
void |
preValidateMoveApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String newQueue) |
|
void |
removeQueue(java.lang.String queueName) |
Remove an existing queue.
|
void |
setClusterMaxPriority(org.apache.hadoop.conf.Configuration conf) |
Set the cluster max priority.
|
void |
setEntitlement(java.lang.String queue,
QueueEntitlement entitlement) |
This method increase the entitlement for current queue (must respect
invariants, e.g., no overcommit of parents, non negative, etc.).
|
org.apache.hadoop.yarn.api.records.Priority |
updateApplicationPriority(org.apache.hadoop.yarn.api.records.Priority newPriority,
org.apache.hadoop.yarn.api.records.ApplicationId applicationId,
org.apache.hadoop.thirdparty.com.google.common.util.concurrent.SettableFuture<java.lang.Object> future,
org.apache.hadoop.security.UserGroupInformation user) |
Change application priority of a submitted application at runtime
|
@Public
@Stable
org.apache.hadoop.yarn.api.records.QueueInfo getQueueInfo(java.lang.String queueName,
boolean includeChildQueues,
boolean recursive)
throws java.io.IOException
queueName - queue nameincludeChildQueues - include child queues?recursive - get children queues?java.io.IOException - an I/O exception has occurred.@Public @Stable java.util.List<org.apache.hadoop.yarn.api.records.QueueUserACLInfo> getQueueUserAclInfo()
@LimitedPrivate("yarn")
@Unstable
org.apache.hadoop.yarn.api.records.Resource getClusterResource()
@Public @Stable org.apache.hadoop.yarn.api.records.Resource getMinimumResourceCapability()
Resource.@Public @Stable org.apache.hadoop.yarn.api.records.Resource getMaximumResourceCapability()
Resource at the cluster level.@Public @Stable org.apache.hadoop.yarn.api.records.Resource getMaximumResourceCapability(java.lang.String queueName)
Resource for the queue specified.queueName - queue name@LimitedPrivate("yarn")
@Evolving
org.apache.hadoop.yarn.util.resource.ResourceCalculator getResourceCalculator()
@Public @Stable int getNumClusterNodes()
@Public @Stable Allocation allocate(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, java.util.List<org.apache.hadoop.yarn.api.records.ResourceRequest> ask, java.util.List<org.apache.hadoop.yarn.api.records.SchedulingRequest> schedulingRequests, java.util.List<org.apache.hadoop.yarn.api.records.ContainerId> release, java.util.List<java.lang.String> blacklistAdditions, java.util.List<java.lang.String> blacklistRemovals, ContainerUpdates updateRequests)
appAttemptId - the id of the application attempt.ask - the request made by an application to obtain various allocations
like host/rack, resource, number of containers, relaxLocality etc.,
see ResourceRequest.schedulingRequests - similar to ask, but with added ability to specify
allocation tags etc., see SchedulingRequest.release - the list of containers to be released.blacklistAdditions - places (node/rack) to be added to the blacklist.blacklistRemovals - places (node/rack) to be removed from the
blacklist.updateRequests - container promotion/demotion updates.Allocation for the application.@LimitedPrivate("yarn")
@Stable
SchedulerNodeReport getNodeReport(org.apache.hadoop.yarn.api.records.NodeId nodeId)
nodeId - nodeId.SchedulerNodeReport for the node or null
if nodeId does not point to a defined node.@LimitedPrivate("yarn")
@Stable
SchedulerAppReport getSchedulerAppInfo(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
appAttemptId - the id of the application attempt@LimitedPrivate("yarn")
@Evolving
org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport getAppResourceUsageReport(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
appAttemptId - the id of the application attempt@LimitedPrivate("yarn")
@Evolving
QueueMetrics getRootQueueMetrics()
boolean checkAccess(org.apache.hadoop.security.UserGroupInformation callerUGI,
org.apache.hadoop.yarn.api.records.QueueACL acl,
java.lang.String queueName)
QueueACL.ADMINISTER_QUEUE permission,
this user can view/modify the applications in this queue.callerUGI - caller UserGroupInformation.acl - queue ACL.queueName - queue Name.true if the user has the permission,
false otherwise@LimitedPrivate("yarn")
@Stable
java.util.List<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> getAppsInQueue(java.lang.String queueName)
queueName - the name of the queue.@LimitedPrivate("yarn")
@Unstable
RMContainer getRMContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
containerId - the given containerId.@LimitedPrivate("yarn")
@Evolving
java.lang.String moveApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String newQueue)
throws org.apache.hadoop.yarn.exceptions.YarnException
appId - application IdnewQueue - the given queue.org.apache.hadoop.yarn.exceptions.YarnException - if the move cannot be carried out@LimitedPrivate("yarn")
@Evolving
void preValidateMoveApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String newQueue)
throws org.apache.hadoop.yarn.exceptions.YarnException
appId - Application IDnewQueue - Target QueueNameorg.apache.hadoop.yarn.exceptions.YarnException - if the pre-validation for move cannot be carried outvoid moveAllApps(java.lang.String sourceQueue,
java.lang.String destQueue)
throws org.apache.hadoop.yarn.exceptions.YarnException
sourceQueue - sourceQueue.destQueue - destQueue.org.apache.hadoop.yarn.exceptions.YarnException - when yarn exception occur.void killAllAppsInQueue(java.lang.String queueName)
throws org.apache.hadoop.yarn.exceptions.YarnException
queueName - the name of queue to be drainedorg.apache.hadoop.yarn.exceptions.YarnException - when yarn exception occur.void removeQueue(java.lang.String queueName)
throws org.apache.hadoop.yarn.exceptions.YarnException
queueName - name of the queue to removeorg.apache.hadoop.yarn.exceptions.YarnException - when yarn exception occur.void addQueue(Queue newQueue) throws org.apache.hadoop.yarn.exceptions.YarnException, java.io.IOException
newQueue - the queue being added.org.apache.hadoop.yarn.exceptions.YarnException - when yarn exception occur.java.io.IOException - when io exception occur.void setEntitlement(java.lang.String queue,
QueueEntitlement entitlement)
throws org.apache.hadoop.yarn.exceptions.YarnException
queue - the queue for which we change entitlemententitlement - the new entitlement for the queue (capacity,
maxCapacity, etc..)org.apache.hadoop.yarn.exceptions.YarnException - when yarn exception occur.java.util.Set<java.lang.String> getPlanQueues()
throws org.apache.hadoop.yarn.exceptions.YarnException
org.apache.hadoop.yarn.exceptions.YarnException - when yarn exception occur.java.util.EnumSet<org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes> getSchedulingResourceTypes()
org.apache.hadoop.yarn.api.records.Priority checkAndGetApplicationPriority(org.apache.hadoop.yarn.api.records.Priority priorityRequestedByApp,
org.apache.hadoop.security.UserGroupInformation user,
java.lang.String queuePath,
org.apache.hadoop.yarn.api.records.ApplicationId applicationId)
throws org.apache.hadoop.yarn.exceptions.YarnException
priorityRequestedByApp - Submitted Application priority.user - User who submitted the ApplicationqueuePath - Name of the QueueapplicationId - Application IDorg.apache.hadoop.yarn.exceptions.YarnException - when yarn exception occur.org.apache.hadoop.yarn.api.records.Priority updateApplicationPriority(org.apache.hadoop.yarn.api.records.Priority newPriority,
org.apache.hadoop.yarn.api.records.ApplicationId applicationId,
org.apache.hadoop.thirdparty.com.google.common.util.concurrent.SettableFuture<java.lang.Object> future,
org.apache.hadoop.security.UserGroupInformation user)
throws org.apache.hadoop.yarn.exceptions.YarnException
newPriority - Submitted Application priority.applicationId - Application IDfuture - Sets any type of exception happened from StateStoreuser - who submitted the applicationorg.apache.hadoop.yarn.exceptions.YarnException - when yarn exception occur.java.util.List<org.apache.hadoop.yarn.api.records.Container> getTransferredContainers(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
appAttemptId - the id of the application attemptvoid setClusterMaxPriority(org.apache.hadoop.conf.Configuration conf)
throws org.apache.hadoop.yarn.exceptions.YarnException
conf - Configuration.org.apache.hadoop.yarn.exceptions.YarnException - when yarn exception occur.java.util.List<org.apache.hadoop.yarn.api.records.ResourceRequest> getPendingResourceRequestsForAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId)
attemptId - the id of the application attemptjava.util.List<org.apache.hadoop.yarn.api.records.SchedulingRequest> getPendingSchedulingRequestsForAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId)
attemptId - the id of the application attemptorg.apache.hadoop.yarn.api.records.Priority getMaxClusterLevelAppPriority()
SchedulerNode getSchedulerNode(org.apache.hadoop.yarn.api.records.NodeId nodeId)
nodeId - the node id of RMNodeorg.apache.hadoop.yarn.api.records.Resource getNormalizedResource(org.apache.hadoop.yarn.api.records.Resource requestedResource,
org.apache.hadoop.yarn.api.records.Resource maxResourceCapability)
requestedResource - the resource to be normalizedmaxResourceCapability - Maximum container allocation value, if null or
empty scheduler level maximum container allocation value will be
used@Public
@Evolving
long checkAndGetApplicationLifetime(java.lang.String queueName,
long lifetime)
queueName - Name of the Queuelifetime - configured application lifetime@Public @Evolving long getMaximumApplicationLifetime(java.lang.String queueName)
queueName - to get lifetimeCopyright © 2008–2025 Apache Software Foundation. All rights reserved.