Class MinCostFlowLeaderBalancer
java.lang.Object
org.apache.iotdb.confignode.manager.load.balancer.router.leader.AbstractLeaderBalancer
org.apache.iotdb.confignode.manager.load.balancer.router.leader.MinCostFlowLeaderBalancer
Leader distribution balancer that uses minimum cost flow algorithm
-
Field Summary
Fields inherited from class org.apache.iotdb.confignode.manager.load.balancer.router.leader.AbstractLeaderBalancer
CFD_POLICY, databaseRegionGroupMap, dataNodeStatisticsMap, GREEDY_POLICY, regionGroupIntersection, regionLeaderMap, regionLocationMap, regionStatisticsMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclear()generateOptimalLeaderDistribution(Map<String, List<TConsensusGroupId>> databaseRegionGroupMap, Map<TConsensusGroupId, Set<Integer>> regionLocationMap, Map<TConsensusGroupId, Integer> regionLeaderMap, Map<Integer, NodeStatistics> dataNodeStatisticsMap, Map<TConsensusGroupId, Map<Integer, RegionStatistics>> regionStatisticsMap) Generate an optimal leader distribution.intintMethods inherited from class org.apache.iotdb.confignode.manager.load.balancer.router.leader.AbstractLeaderBalancer
initialize, isDataNodeAvailable, isRegionAvailable
-
Constructor Details
-
MinCostFlowLeaderBalancer
public MinCostFlowLeaderBalancer()
-
-
Method Details
-
generateOptimalLeaderDistribution
public Map<TConsensusGroupId,Integer> generateOptimalLeaderDistribution(Map<String, List<TConsensusGroupId>> databaseRegionGroupMap, Map<TConsensusGroupId, Set<Integer>> regionLocationMap, Map<TConsensusGroupId, Integer> regionLeaderMap, Map<Integer, NodeStatistics> dataNodeStatisticsMap, Map<TConsensusGroupId, Map<Integer, RegionStatistics>> regionStatisticsMap) Description copied from class:AbstractLeaderBalancerGenerate an optimal leader distribution.- Specified by:
generateOptimalLeaderDistributionin classAbstractLeaderBalancer- Parameters:
databaseRegionGroupMap- RegionGroup held by each DatabaseregionLocationMap- All RegionGroups the cluster currently haveregionLeaderMap- The current leader distribution of each RegionGroupdataNodeStatisticsMap- The current statistics of each DataNoderegionStatisticsMap- The current statistics of each Region- Returns:
- Map<TConsensusGroupId, Integer>, The optimal leader distribution
-
clear
protected void clear()- Overrides:
clearin classAbstractLeaderBalancer
-
getMaximumFlow
public int getMaximumFlow() -
getMinimumCost
public int getMinimumCost()
-