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