Class WRRPlacementStrategy

  • All Implemented Interfaces:
    PlacementStrategy

    public class WRRPlacementStrategy
    extends java.lang.Object
    implements PlacementStrategy
    This class implements PlacementStrategy based on Weighted Round Robin Algorithm.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ResourceUnit findBrokerForPlacement​(com.google.common.collect.Multimap<java.lang.Long,​ResourceUnit> finalCandidates)
      Function : getByWeightedRoundRobin returns ResourceUnit selected by WRR algorithm based on available resource on RU.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WRRPlacementStrategy

        public WRRPlacementStrategy()
    • Method Detail

      • findBrokerForPlacement

        public ResourceUnit findBrokerForPlacement​(com.google.common.collect.Multimap<java.lang.Long,​ResourceUnit> finalCandidates)
        Function : getByWeightedRoundRobin returns ResourceUnit selected by WRR algorithm based on available resource on RU. ^ | | | | | | | | | | | | | | Broker 2 | Broker 3 | Broker 1 | B4 | | | | | | +----------------+------------------------+--------------------------------+---------> 0 20 50 90 100 This is weighted Round robin, we calculate weight based on availability of resources; total availability is taken as a full range then each broker is given range based on its resource availability, if the number generated within total range happens to be in broker's range, that broker is selected
        Specified by:
        findBrokerForPlacement in interface PlacementStrategy