Class RegionReplicaCandidateGenerator
java.lang.Object
org.apache.hadoop.hbase.master.balancer.CandidateGenerator
org.apache.hadoop.hbase.master.balancer.RegionReplicaCandidateGenerator
- Direct Known Subclasses:
RegionReplicaRackCandidateGenerator
Generates candidates which moves the replicas out of the region server for co-hosted region
replicas
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) BalanceAction
generate
(BalancerClusterState cluster) (package private) int
selectCoHostedRegionPerGroup
(org.agrona.collections.Int2IntCounterMap colocatedReplicaCountsPerGroup, int[] regionsPerGroup, int[] regionIndexToPrimaryIndex) Randomly select one regionIndex out of all region replicas co-hosted in the same group (a group is a server, host or rack)Methods inherited from class org.apache.hadoop.hbase.master.balancer.CandidateGenerator
getAction, pickOtherRandomRack, pickOtherRandomServer, pickRandomRack, pickRandomRegion, pickRandomRegions, pickRandomServer
-
Field Details
-
randomGenerator
-
-
Constructor Details
-
RegionReplicaCandidateGenerator
-
-
Method Details
-
selectCoHostedRegionPerGroup
int selectCoHostedRegionPerGroup(org.agrona.collections.Int2IntCounterMap colocatedReplicaCountsPerGroup, int[] regionsPerGroup, int[] regionIndexToPrimaryIndex) Randomly select one regionIndex out of all region replicas co-hosted in the same group (a group is a server, host or rack)- Parameters:
colocatedReplicaCountsPerGroup
- either Cluster.colocatedReplicaCountsPerServer, colocatedReplicaCountsPerHost or colocatedReplicaCountsPerRackregionsPerGroup
- either Cluster.regionsPerServer, regionsPerHost or regionsPerRackregionIndexToPrimaryIndex
- Cluster.regionsIndexToPrimaryIndex- Returns:
- a regionIndex for the selected primary or -1 if there is no co-locating
-
generate
- Specified by:
generate
in classCandidateGenerator
-