public class ExecSorterByConnectionCount extends Object implements IExecSorter
Modifier and Type | Field and Description |
---|---|
protected TopologyDetails |
topologyDetails |
Constructor and Description |
---|
ExecSorterByConnectionCount(TopologyDetails topologyDetails) |
Modifier and Type | Method and Description |
---|---|
List<ExecutorDetails> |
sortExecutors(Set<ExecutorDetails> unassignedExecutors)
Order executors based on how many in and out connections it will potentially need to make, in descending order.
|
protected TopologyDetails topologyDetails
public ExecSorterByConnectionCount(TopologyDetails topologyDetails)
public List<ExecutorDetails> sortExecutors(Set<ExecutorDetails> unassignedExecutors)
Order executors based on how many in and out connections it will potentially need to make, in descending order. First order components by the number of in and out connections it will have. Then iterate through the sorted list of components. For each component sort the neighbors of that component by how many connections it will have to make with that component. Add an executor from this component and then from each neighboring component in sorted order. Do this until there is nothing left to schedule. Then add back executors not accounted for - which are system executors.
sortExecutors
in interface IExecSorter
unassignedExecutors
- an unmodifiable set of executors that need to be scheduled.Copyright © 2022 The Apache Software Foundation. All rights reserved.