public interface SchedulingPlacementSet<N extends SchedulerNode>
Comparing to PlacementSet
, this also maintains
pending ResourceRequests:
- When new ResourceRequest(s) added to scheduler, or,
- Or new container allocated, scheduler can notify corresponding
PlacementSet.
Different set of resource requests (E.g., resource requests with the same schedulerKey) can have one instance of PlacementSet, each PlacementSet can have different ways to order nodes depends on requests.
Modifier and Type | Method and Description |
---|---|
boolean |
acceptNodePartition(String nodePartition,
SchedulingMode schedulingMode)
Does this
SchedulingPlacementSet accept resources on nodePartition? |
List<org.apache.hadoop.yarn.api.records.ResourceRequest> |
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 (wangda): This should be moved out of SchedulingPlacementSet
and should belong to specific delay scheduling policy impl.
|
Iterator<String> |
getAcceptedResouceNames()
Returns list of accepted resourceNames.
|
int |
getOutstandingAsksCount(String resourceName)
Get #pending-allocations for given resourceName.
|
PendingAsk |
getPendingAsk(String resourceName)
Get pending ask for given resourceName.
|
Iterator<N> |
getPreferredNodeIterator(PlacementSet<N> clusterPlacementSet)
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
|
int |
getUniqueLocationAsks() |
void |
showRequests()
Print human-readable requests to LOG debug.
|
ResourceRequestUpdateResult |
updateResourceRequests(Collection<org.apache.hadoop.yarn.api.records.ResourceRequest> requests,
boolean recoverPreemptedRequestForAContainer)
Replace existing ResourceRequest by the new requests
|
Iterator<N> getPreferredNodeIterator(PlacementSet<N> clusterPlacementSet)
clusterPlacementSet
- input cluster PlacementSetResourceRequestUpdateResult updateResourceRequests(Collection<org.apache.hadoop.yarn.api.records.ResourceRequest> requests, boolean recoverPreemptedRequestForAContainer)
requests
- new ResourceRequestsrecoverPreemptedRequestForAContainer
- if we're recovering resource
requests for preempted containerMap<String,org.apache.hadoop.yarn.api.records.ResourceRequest> getResourceRequests()
PendingAsk getPendingAsk(String resourceName)
PendingAsk.ZERO
resourceName
- resourceNameint getOutstandingAsksCount(String resourceName)
resourceName
- resourceNameList<org.apache.hadoop.yarn.api.records.ResourceRequest> allocate(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, NodeType type, SchedulerNode node)
schedulerKey
- SchedulerRequestKey for this ResourceRequesttype
- Type of the allocationnode
- Which node this container allocated onIterator<String> getAcceptedResouceNames()
boolean canAllocate(NodeType type, SchedulerNode node)
type
- Locality Typenode
- which node we will allocate onboolean canDelayTo(String resourceName)
resourceName
- resourceNameboolean acceptNodePartition(String nodePartition, SchedulingMode schedulingMode)
SchedulingPlacementSet
accept resources on nodePartition?nodePartition
- nodePartitionschedulingMode
- schedulingModeString getPrimaryRequestedNodePartition()
int getUniqueLocationAsks()
void showRequests()
Copyright © 2020 Apache Software Foundation. All rights reserved.