Interface ResourceScheduler
- All Superinterfaces:
org.apache.hadoop.yarn.event.EventHandler<SchedulerEvent>,Recoverable,YarnScheduler
- All Known Subinterfaces:
MutableConfScheduler,PreemptableResourceScheduler
- All Known Implementing Classes:
AbstractYarnScheduler,CapacityScheduler,FairScheduler,FifoScheduler
@LimitedPrivate("yarn")
@Evolving
public interface ResourceScheduler
extends YarnScheduler, Recoverable
This interface is the one implemented by the schedulers. It mainly extends
YarnScheduler.-
Method Summary
Modifier and TypeMethodDescriptionbooleanattemptAllocationOnNode(SchedulerApplicationAttempt appAttempt, org.apache.hadoop.yarn.api.records.SchedulingRequest schedulingRequest, SchedulerNode schedulerNode) Attempts to allocate a SchedulerRequest on a Node.List<org.apache.hadoop.yarn.api.records.NodeId>getNodeIds(String resourceName) Get theNodeIdavailable in the cluster by resource name.voidreinitialize(org.apache.hadoop.conf.Configuration conf, RMContext rmContext) Re-initialize theResourceScheduler.voidReset scheduler metrics.voidsetRMContext(RMContext rmContext) Set RMContext forResourceScheduler.Methods inherited from interface org.apache.hadoop.yarn.event.EventHandler
handleMethods inherited from interface org.apache.hadoop.yarn.server.resourcemanager.recovery.Recoverable
recoverMethods inherited from interface org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler
addQueue, allocate, checkAccess, checkAndGetApplicationLifetime, checkAndGetApplicationPriority, getAppResourceUsageReport, getAppsInQueue, getClusterResource, getMaxClusterLevelAppPriority, getMaximumApplicationLifetime, getMaximumResourceCapability, getMaximumResourceCapability, getMinimumResourceCapability, getNodeReport, getNormalizedResource, getNumClusterNodes, getPendingResourceRequestsForAttempt, getPendingSchedulingRequestsForAttempt, getPlanQueues, getQueueInfo, getQueueUserAclInfo, getResourceCalculator, getRMContainer, getRootQueueMetrics, getSchedulerAppInfo, getSchedulerNode, getSchedulingResourceTypes, getTransferredContainers, killAllAppsInQueue, moveAllApps, moveApplication, preValidateMoveApplication, removeQueue, setClusterMaxPriority, setEntitlement, updateApplicationPriority
-
Method Details
-
setRMContext
Set RMContext forResourceScheduler. This method should be called immediately after instantiating a scheduler once.- Parameters:
rmContext- created by ResourceManager
-
reinitialize
void reinitialize(org.apache.hadoop.conf.Configuration conf, RMContext rmContext) throws IOException Re-initialize theResourceScheduler.- Parameters:
conf- configurationrmContext- RMContext.- Throws:
IOException- an I/O exception has occurred.
-
getNodeIds
Get theNodeIdavailable in the cluster by resource name.- Parameters:
resourceName- resource name- Returns:
- the number of available
NodeIdby resource name.
-
attemptAllocationOnNode
boolean attemptAllocationOnNode(SchedulerApplicationAttempt appAttempt, org.apache.hadoop.yarn.api.records.SchedulingRequest schedulingRequest, SchedulerNode schedulerNode) Attempts to allocate a SchedulerRequest on a Node. NOTE: This ignores the numAllocations in the resource sizing and tries to allocate a SINGLE container only.- Parameters:
appAttempt- ApplicationAttempt.schedulingRequest- SchedulingRequest.schedulerNode- SchedulerNode.- Returns:
- true if proposal was accepted.
-
resetSchedulerMetrics
void resetSchedulerMetrics()Reset scheduler metrics.
-