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 Details

  • Constructor Details

  • 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 colocatedReplicaCountsPerRack
      regionsPerGroup - either Cluster.regionsPerServer, regionsPerHost or regionsPerRack
      regionIndexToPrimaryIndex - Cluster.regionsIndexToPrimaryIndex
      Returns:
      a regionIndex for the selected primary or -1 if there is no co-locating
    • generate

      Specified by:
      generate in class CandidateGenerator