@InterfaceAudience.Private class RegionReplicaCandidateGenerator extends CandidateGenerator
Modifier and Type | Field and Description |
---|---|
(package private) StochasticLoadBalancer.RandomCandidateGenerator |
randomGenerator |
Constructor and Description |
---|
RegionReplicaCandidateGenerator() |
Modifier and Type | Method and Description |
---|---|
(package private) BaseLoadBalancer.Cluster.Action |
generate(BaseLoadBalancer.Cluster cluster) |
(package private) int |
selectCoHostedRegionPerGroup(int[] primariesOfRegionsPerGroup,
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, getRandomIterationOrder, pickOtherRandomRack, pickOtherRandomServer, pickRandomRack, pickRandomRegion, pickRandomRegions, pickRandomServer
StochasticLoadBalancer.RandomCandidateGenerator randomGenerator
RegionReplicaCandidateGenerator()
int selectCoHostedRegionPerGroup(int[] primariesOfRegionsPerGroup, int[] regionsPerGroup, int[] regionIndexToPrimaryIndex)
primariesOfRegionsPerGroup
- either Cluster.primariesOfRegionsPerServer,
primariesOfRegionsPerHost or primariesOfRegionsPerRackregionsPerGroup
- either Cluster.regionsPerServer, regionsPerHost or regionsPerRackregionIndexToPrimaryIndex
- Cluster.regionsIndexToPrimaryIndexBaseLoadBalancer.Cluster.Action generate(BaseLoadBalancer.Cluster cluster)
generate
in class CandidateGenerator
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.