Interface IPriorityBalancer
- All Known Implementing Classes:
GreedyPriorityBalancer,LeaderPriorityBalancer
public interface IPriorityBalancer
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongenerateOptimalRoutePriority(List<TRegionReplicaSet> replicaSets, Map<TConsensusGroupId, Integer> regionLeaderMap) Generate an optimal route priority.
-
Field Details
-
LEADER_POLICY
- See Also:
-
GREEDY_POLICY
- See Also:
-
-
Method Details
-
generateOptimalRoutePriority
Map<TConsensusGroupId,TRegionReplicaSet> generateOptimalRoutePriority(List<TRegionReplicaSet> replicaSets, Map<TConsensusGroupId, Integer> regionLeaderMap) Generate an optimal route priority.- Parameters:
replicaSets- All RegionGroupsregionLeaderMap- The current leader of each RegionGroup- Returns:
- Map<TConsensusGroupId, TRegionReplicaSet>, The optimal route priority for each RegionGroup. The replica with higher sorting result have higher priority.
-