public class SingleConstraintAppPlacementAllocator<N extends SchedulerNode> extends AppPlacementAllocator<N>
appSchedulingInfo, rmContext, schedulerRequestKey| Constructor and Description | 
|---|
| SingleConstraintAppPlacementAllocator() | 
| Modifier and Type | Method and Description | 
|---|---|
| ContainerRequest | allocate(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey,
        NodeType type,
        SchedulerNode node)Notify container allocated. | 
| boolean | canAllocate(NodeType type,
           SchedulerNode node)We can still have pending requirement for a given NodeType and node | 
| boolean | canDelayTo(String resourceName)Can delay to give locality?
 TODO: This should be moved out of AppPlacementAllocator
 and should belong to specific delay scheduling policy impl. | 
| int | getOutstandingAsksCount(String resourceName)Get #pending-allocations for given resourceName. | 
| PendingAsk | getPendingAsk(String resourceName)Get pending ask for given resourceName. | 
| Iterator<N> | getPreferredNodeIterator(CandidateNodeSet<N> candidateNodeSet)Get iterator of preferred node depends on requirement and/or availability. | 
| String | getPrimaryRequestedNodePartition()It is possible that one request can accept multiple node partition,
 So this method returns primary node partition for pending resource /
 headroom calculation. | 
| Map<String,org.apache.hadoop.yarn.api.records.ResourceRequest> | getResourceRequests()Get pending ResourceRequests by given schedulerRequestKey | 
| org.apache.hadoop.yarn.api.records.SchedulingRequest | getSchedulingRequest()Get pending SchedulingRequest. | 
| int | getUniqueLocationAsks() | 
| void | initialize(AppSchedulingInfo appSchedulingInfo,
          org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerRequestKey,
          RMContext rmContext)Initialize this allocator, this will be called by Factory automatically. | 
| boolean | precheckNode(SchedulerNode schedulerNode,
            SchedulingMode schedulingMode) | 
| boolean | precheckNode(SchedulerNode schedulerNode,
            SchedulingMode schedulingMode,
            Optional<DiagnosticsCollector> dcOpt)Does this  AppPlacementAllocatoraccept resources on given node? | 
| void | showRequests()Print human-readable requests to LOG debug. | 
| PendingAskUpdateResult | updatePendingAsk(Collection<org.apache.hadoop.yarn.api.records.ResourceRequest> requests,
                boolean recoverPreemptedRequestForAContainer)Replace existing pending asks by the new requests | 
| PendingAskUpdateResult | updatePendingAsk(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerRequestKey,
                org.apache.hadoop.yarn.api.records.SchedulingRequest newSchedulingRequest,
                boolean recoverPreemptedRequestForAContainer)Replace existing pending asks by the new SchedulingRequest | 
getPlacementAttempt, incrementPlacementAttemptpublic SingleConstraintAppPlacementAllocator()
public Iterator<N> getPreferredNodeIterator(CandidateNodeSet<N> candidateNodeSet)
AppPlacementAllocatorgetPreferredNodeIterator in class AppPlacementAllocator<N extends SchedulerNode>candidateNodeSet - input CandidateNodeSetpublic PendingAskUpdateResult updatePendingAsk(Collection<org.apache.hadoop.yarn.api.records.ResourceRequest> requests, boolean recoverPreemptedRequestForAContainer)
AppPlacementAllocatorupdatePendingAsk in class AppPlacementAllocator<N extends SchedulerNode>requests - new asksrecoverPreemptedRequestForAContainer - if we're recovering resource
 requests for preempted containerpublic PendingAskUpdateResult updatePendingAsk(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerRequestKey, org.apache.hadoop.yarn.api.records.SchedulingRequest newSchedulingRequest, boolean recoverPreemptedRequestForAContainer)
AppPlacementAllocatorupdatePendingAsk in class AppPlacementAllocator<N extends SchedulerNode>schedulerRequestKey - scheduler request keynewSchedulingRequest - new asksrecoverPreemptedRequestForAContainer - if we're recovering resource
                                             requests for preempted containerpublic Map<String,org.apache.hadoop.yarn.api.records.ResourceRequest> getResourceRequests()
AppPlacementAllocatorgetResourceRequests in class AppPlacementAllocator<N extends SchedulerNode>public PendingAsk getPendingAsk(String resourceName)
AppPlacementAllocatorPendingAsk.ZEROgetPendingAsk in class AppPlacementAllocator<N extends SchedulerNode>resourceName - resourceNamepublic int getOutstandingAsksCount(String resourceName)
AppPlacementAllocatorgetOutstandingAsksCount in class AppPlacementAllocator<N extends SchedulerNode>resourceName - resourceNamepublic ContainerRequest allocate(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, NodeType type, SchedulerNode node)
AppPlacementAllocatorallocate in class AppPlacementAllocator<N extends SchedulerNode>schedulerKey - SchedulerRequestKey for this ResourceRequesttype - Type of the allocationnode - Which node this container allocated onContainerRequest for more details.public boolean canAllocate(NodeType type, SchedulerNode node)
AppPlacementAllocatorcanAllocate in class AppPlacementAllocator<N extends SchedulerNode>type - Locality Typenode - which node we will allocate onpublic boolean canDelayTo(String resourceName)
AppPlacementAllocatorcanDelayTo in class AppPlacementAllocator<N extends SchedulerNode>resourceName - resourceNamepublic boolean precheckNode(SchedulerNode schedulerNode, SchedulingMode schedulingMode)
precheckNode in class AppPlacementAllocator<N extends SchedulerNode>public boolean precheckNode(SchedulerNode schedulerNode, SchedulingMode schedulingMode, Optional<DiagnosticsCollector> dcOpt)
AppPlacementAllocatorAppPlacementAllocator accept resources on given node?precheckNode in class AppPlacementAllocator<N extends SchedulerNode>schedulerNode - schedulerNodeschedulingMode - schedulingModedcOpt - optional diagnostics collectorpublic String getPrimaryRequestedNodePartition()
AppPlacementAllocatorgetPrimaryRequestedNodePartition in class AppPlacementAllocator<N extends SchedulerNode>public int getUniqueLocationAsks()
getUniqueLocationAsks in class AppPlacementAllocator<N extends SchedulerNode>public void showRequests()
AppPlacementAllocatorshowRequests in class AppPlacementAllocator<N extends SchedulerNode>public org.apache.hadoop.yarn.api.records.SchedulingRequest getSchedulingRequest()
AppPlacementAllocatorgetSchedulingRequest in class AppPlacementAllocator<N extends SchedulerNode>public void initialize(AppSchedulingInfo appSchedulingInfo, org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerRequestKey, RMContext rmContext)
AppPlacementAllocatorinitialize in class AppPlacementAllocator<N extends SchedulerNode>appSchedulingInfo - appSchedulingInfoschedulerRequestKey - schedulerRequestKeyrmContext - rmContextCopyright © 2008–2023 Apache Software Foundation. All rights reserved.