Apache9 commented on a change in pull request #3732:
URL: https://github.com/apache/hbase/pull/3732#discussion_r744130876
##########
File path:
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/CostFunction.java
##########
@@ -83,6 +83,10 @@ protected void regionMoved(int region, int oldServer, int
newServer) {
protected abstract double cost();
+ protected void updateWeight(double[] weights) {
Review comment:
Where do we call this method?
##########
File path:
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
##########
@@ -384,6 +390,27 @@ BalanceAction nextAction(BalancerClusterState cluster) {
.generate(cluster);
}
+ private CandidateGenerator getRandomGenerate() {
Review comment:
We do not call this private method?
##########
File path:
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
##########
@@ -204,10 +209,11 @@ protected float getDefaultSlop() {
protected List<CandidateGenerator> createCandidateGenerators() {
List<CandidateGenerator> candidateGenerators = new
ArrayList<CandidateGenerator>(4);
- candidateGenerators.add(new RandomCandidateGenerator());
- candidateGenerators.add(new LoadCandidateGenerator());
- candidateGenerators.add(localityCandidateGenerator);
- candidateGenerators.add(new RegionReplicaRackCandidateGenerator());
+ candidateGenerators.add(GeneratorType.RANDOM.ordinal(), new
RandomCandidateGenerator());
Review comment:
I prefer we just attach the generator to the enum, so here we could
write a for loop instead of typing all the enums by hand.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]