Class GreedyLeaderBalancer
java.lang.Object
org.apache.iotdb.confignode.manager.load.balancer.router.leader.AbstractLeaderBalancer
org.apache.iotdb.confignode.manager.load.balancer.router.leader.GreedyLeaderBalancer
Leader distribution balancer that uses greedy 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 TypeMethodDescriptiongenerateOptimalLeaderDistribution(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.Methods inherited from class org.apache.iotdb.confignode.manager.load.balancer.router.leader.AbstractLeaderBalancer
clear, initialize, isDataNodeAvailable, isRegionAvailable
-
Constructor Details
-
GreedyLeaderBalancer
public GreedyLeaderBalancer()
-
-
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
-