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.
| Modifier and Type | Field and Description | 
|---|---|
| protected Comparator<N> | comparator | 
| protected Map<String,Set<N>> | nodesPerPartition | 
| Constructor and Description | 
|---|
| ResourceUsageMultiNodeLookupPolicy() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addAndRefreshNodesSet(Collection<N> nodes,
                     String partition)Refresh working nodes set for re-ordering based on the algorithm selected. | 
| Set<N> | getNodesPerPartition(String partition)Get sorted nodes per partition. | 
| Iterator<N> | getPreferredNodeIterator(Collection<N> nodes,
                        String partition)Get iterator of preferred node depends on requirement and/or availability. | 
protected Map<String,Set<N extends SchedulerNode>> nodesPerPartition
protected Comparator<N extends SchedulerNode> comparator
public Iterator<N> getPreferredNodeIterator(Collection<N> nodes, String partition)
MultiNodeLookupPolicygetPreferredNodeIterator in interface MultiNodeLookupPolicy<N extends SchedulerNode>nodes - List of Nodespartition - node labelpublic void addAndRefreshNodesSet(Collection<N> nodes, String partition)
MultiNodeLookupPolicyaddAndRefreshNodesSet in interface MultiNodeLookupPolicy<N extends SchedulerNode>nodes - a collection working nm's.public Set<N> getNodesPerPartition(String partition)
MultiNodeLookupPolicygetNodesPerPartition in interface MultiNodeLookupPolicy<N extends SchedulerNode>partition - node labelCopyright © 2008–2023 Apache Software Foundation. All rights reserved.