public class WRRPlacementStrategy extends Object implements PlacementStrategy
| Constructor and Description |
|---|
WRRPlacementStrategy() |
| Modifier and Type | Method and Description |
|---|---|
ResourceUnit |
findBrokerForPlacement(com.google.common.collect.Multimap<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
|
public ResourceUnit findBrokerForPlacement(com.google.common.collect.Multimap<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
findBrokerForPlacement in interface PlacementStrategyCopyright © 2017–2021 Apache Software Foundation. All rights reserved.