Package io.prestosql.execution.scheduler
Class TopologyAwareNodeSelector
- java.lang.Object
-
- io.prestosql.execution.scheduler.TopologyAwareNodeSelector
-
- All Implemented Interfaces:
NodeSelector
public class TopologyAwareNodeSelector extends Object implements NodeSelector
-
-
Constructor Summary
Constructors Constructor Description TopologyAwareNodeSelector(InternalNodeManager nodeManager, NodeTaskMap nodeTaskMap, boolean includeCoordinator, Supplier<NodeMap> nodeMap, int minCandidates, int maxSplitsPerNode, int maxPendingSplitsPerTask, List<io.airlift.stats.CounterStat> topologicalSplitCounters, NetworkTopology networkTopology)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<InternalNode>
allNodes()
SplitPlacementResult
computeAssignments(Set<Split> splits, List<RemoteTask> existingTasks)
Identifies the nodes for running the specified splits.SplitPlacementResult
computeAssignments(Set<Split> splits, List<RemoteTask> existingTasks, BucketNodeMap bucketNodeMap)
Identifies the nodes for running the specified splits based on a precomputed fixed partitioning.void
lockDownNodes()
InternalNode
selectCurrentNode()
List<InternalNode>
selectRandomNodes(int limit, Set<InternalNode> excludedNodes)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.prestosql.execution.scheduler.NodeSelector
selectRandomNodes
-
-
-
-
Constructor Detail
-
TopologyAwareNodeSelector
public TopologyAwareNodeSelector(InternalNodeManager nodeManager, NodeTaskMap nodeTaskMap, boolean includeCoordinator, Supplier<NodeMap> nodeMap, int minCandidates, int maxSplitsPerNode, int maxPendingSplitsPerTask, List<io.airlift.stats.CounterStat> topologicalSplitCounters, NetworkTopology networkTopology)
-
-
Method Detail
-
lockDownNodes
public void lockDownNodes()
- Specified by:
lockDownNodes
in interfaceNodeSelector
-
allNodes
public List<InternalNode> allNodes()
- Specified by:
allNodes
in interfaceNodeSelector
-
selectCurrentNode
public InternalNode selectCurrentNode()
- Specified by:
selectCurrentNode
in interfaceNodeSelector
-
selectRandomNodes
public List<InternalNode> selectRandomNodes(int limit, Set<InternalNode> excludedNodes)
- Specified by:
selectRandomNodes
in interfaceNodeSelector
-
computeAssignments
public SplitPlacementResult computeAssignments(Set<Split> splits, List<RemoteTask> existingTasks)
Description copied from interface:NodeSelector
Identifies the nodes for running the specified splits.- Specified by:
computeAssignments
in interfaceNodeSelector
- Parameters:
splits
- the splits that need to be assigned to nodes- Returns:
- a multimap from node to splits only for splits for which we could identify a node to schedule on. If we cannot find an assignment for a split, it is not included in the map. Also returns a future indicating when to reattempt scheduling of this batch of splits, if some of them could not be scheduled.
-
computeAssignments
public SplitPlacementResult computeAssignments(Set<Split> splits, List<RemoteTask> existingTasks, BucketNodeMap bucketNodeMap)
Description copied from interface:NodeSelector
Identifies the nodes for running the specified splits based on a precomputed fixed partitioning.- Specified by:
computeAssignments
in interfaceNodeSelector
- Parameters:
splits
- the splits that need to be assigned to nodes- Returns:
- a multimap from node to splits only for splits for which we could identify a node with free space. If we cannot find an assignment for a split, it is not included in the map. Also returns a future indicating when to reattempt scheduling of this batch of splits, if some of them could not be scheduled.
-
-