Package org.apache.storm.scheduler.resource.strategies.scheduling.sorter

# Class ExecSorterByConnectionCount

java.lang.Object
org.apache.storm.scheduler.resource.strategies.scheduling.sorter.ExecSorterByConnectionCount

All Implemented Interfaces:
  `IExecSorter`

public class ExecSorterByConnectionCount extends Object implements IExecSorter

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected TopologyDetails`
  `topologyDetails`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ExecSorterByConnectionCount(TopologyDetails topologyDetails)`

- ## Method Summary

  Modifier and Type
  Method
  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.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### topologyDetails

    protected TopologyDetails topologyDetails

- ## Constructor Details

  - ### ExecSorterByConnectionCount

    public ExecSorterByConnectionCount(TopologyDetails topologyDetails)

- ## Method Details

  - ### sortExecutors

    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.
    Specified by:
      `sortExecutors` in interface `IExecSorter`
    Parameters:
      `unassignedExecutors` - an unmodifiable set of executors that need to be scheduled.
    Returns:
      a list of executors in sorted order for scheduling.