Class ResourceUsageMultiNodeLookupPolicy<N extends SchedulerNode>
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.ResourceUsageMultiNodeLookupPolicy<N>
- All Implemented Interfaces:
MultiNodeLookupPolicy<N>
public class ResourceUsageMultiNodeLookupPolicy<N extends SchedulerNode>
extends Object
implements MultiNodeLookupPolicy<N>
This class has the following functionality:
ResourceUsageMultiNodeLookupPolicy holds sorted nodes list based on the resource usage of nodes at given time.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAndRefreshNodesSet(Collection<N> nodes, String partition) Refresh working nodes set for re-ordering based on the algorithm selected.getNodesPerPartition(String partition) Get sorted nodes per partition.getPreferredNodeIterator(Collection<N> nodes, String partition) Get iterator of preferred node depends on requirement and/or availability.
-
Field Details
-
nodesPerPartition
-
comparator
-
-
Constructor Details
-
ResourceUsageMultiNodeLookupPolicy
public ResourceUsageMultiNodeLookupPolicy()
-
-
Method Details
-
getPreferredNodeIterator
Description copied from interface:MultiNodeLookupPolicyGet iterator of preferred node depends on requirement and/or availability.- Specified by:
getPreferredNodeIteratorin interfaceMultiNodeLookupPolicy<N extends SchedulerNode>- Parameters:
nodes- List of Nodespartition- node label- Returns:
- iterator of preferred node
-
addAndRefreshNodesSet
Description copied from interface:MultiNodeLookupPolicyRefresh working nodes set for re-ordering based on the algorithm selected.- Specified by:
addAndRefreshNodesSetin interfaceMultiNodeLookupPolicy<N extends SchedulerNode>- Parameters:
nodes- a collection working nm's.partition- node label
-
getNodesPerPartition
Description copied from interface:MultiNodeLookupPolicyGet sorted nodes per partition.- Specified by:
getNodesPerPartitionin interfaceMultiNodeLookupPolicy<N extends SchedulerNode>- Parameters:
partition- node label- Returns:
- collection of sorted nodes
-