@InterfaceAudience.Private class LocalityBasedCandidateGenerator extends CandidateGenerator
Constructor and Description |
---|
LocalityBasedCandidateGenerator() |
Modifier and Type | Method and Description |
---|---|
(package private) BalanceAction |
generate(BalancerClusterState cluster) |
private double |
getWeightedLocality(BalancerClusterState cluster,
int region,
int server) |
private Optional<BalanceAction> |
tryMoveOrSwap(BalancerClusterState cluster,
int fromServer,
int fromRegion,
int toServer) |
getAction, pickOtherRandomRack, pickOtherRandomServer, pickRandomRack, pickRandomRegion, pickRandomRegions, pickRandomServer
LocalityBasedCandidateGenerator()
BalanceAction generate(BalancerClusterState cluster)
generate
in class CandidateGenerator
private Optional<BalanceAction> tryMoveOrSwap(BalancerClusterState cluster, int fromServer, int fromRegion, int toServer)
private double getWeightedLocality(BalancerClusterState cluster, int region, int server)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.