@InterfaceAudience.Private class RegionReplicaCandidateGenerator extends CandidateGenerator
Modifier and Type | Field and Description |
---|---|
protected RandomCandidateGenerator |
randomGenerator |
Constructor and Description |
---|
RegionReplicaCandidateGenerator() |
Modifier and Type | Method and Description |
---|---|
(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)
|
getAction, pickOtherRandomRack, pickOtherRandomServer, pickRandomRack, pickRandomRegion, pickRandomRegions, pickRandomServer
protected final RandomCandidateGenerator randomGenerator
RegionReplicaCandidateGenerator()
int selectCoHostedRegionPerGroup(org.agrona.collections.Int2IntCounterMap colocatedReplicaCountsPerGroup, int[] regionsPerGroup, int[] regionIndexToPrimaryIndex)
colocatedReplicaCountsPerGroup
- either Cluster.colocatedReplicaCountsPerServer,
colocatedReplicaCountsPerHost or
colocatedReplicaCountsPerRackregionsPerGroup
- either Cluster.regionsPerServer, regionsPerHost or
regionsPerRackregionIndexToPrimaryIndex
- Cluster.regionsIndexToPrimaryIndexBalanceAction generate(BalancerClusterState cluster)
generate
in class CandidateGenerator
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.