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
Fields - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescription(package private) BalanceActiongenerate(BalancerClusterState cluster) (package private) intselectCoHostedRegionPerGroup(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:
 generatein classCandidateGenerator
 
 -