Class NodeSorterHostProximity

    • Method Detail

      • getSortedRacks

        public Iterable<ObjectResourcesItem> getSortedRacks()
        Racks are sorted by two criteria.

        1) the number executors of the topology that needs to be scheduled is already on the rack in descending order. The reasoning to sort based on criterion 1 is so we schedule the rest of a topology on the same rack as the existing executors of the topology.

        2) the subordinate/subservient resource availability percentage of a rack in descending order We calculate the resource availability percentage by dividing the resource availability on the rack by the resource availability of the entire cluster By doing this calculation, racks that have exhausted or little of one of the resources mentioned above will be ranked after racks that have more balanced resource availability. So we will be less likely to pick a rack that have a lot of one resource but a low amount of another.

        Specified by:
        getSortedRacks in interface INodeSorter
        Returns:
        an iterable of sorted racks
      • hostnameToNodes

        public List<RasNode> hostnameToNodes​(String hostname)
        hostname to Ids.
        Parameters:
        hostname - the hostname.
        Returns:
        the ids n that node.