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

## Class ExecSorterByProximity

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

- All Implemented Interfaces:
    `IExecSorter`

      public class ExecSorterByProximity
      extends Object
      implements IExecSorter

- - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ExecSorterByProximity​(TopologyDetails topologyDetails)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `List<ExecutorDetails>` | `sortExecutors​(Set<ExecutorDetails> unassignedExecutors)` | Order executors by network proximity needs.

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

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

- - ### Field Detail

    - #### topologyDetails

          protected TopologyDetails topologyDetails

  - ### Constructor Detail

    - #### ExecSorterByProximity

          public ExecSorterByProximity​(TopologyDetails topologyDetails)

  - ### Method Detail

    - #### sortExecutors

          public List<ExecutorDetails> sortExecutors​(Set<ExecutorDetails> unassignedExecutors)

      Order executors by network proximity needs. First add all executors for components that are in topological sorted order. 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.