virajjasani commented on a change in pull request #1511: HBASE-24139 : Balancer
should avoid leaving idle region servers
URL: https://github.com/apache/hbase/pull/1511#discussion_r409630869
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
##########
@@ -1223,6 +1225,20 @@ protected boolean
areSomeRegionReplicasColocated(Cluster c) {
return false;
}
+ protected final synchronized boolean idleRegionExist(Cluster c){
+ boolean isServerExistsWithMoreRegions = false;
+ boolean isServerExistsWithZeroRegions = false;
+ for (int[] serverList: c.regionsPerServer){
+ if (serverList.length > 1) {
+ isServerExistsWithMoreRegions = true;
+ }
+ if (serverList.length < 1) {
Review comment:
nit: this can be `serverList.length == 0`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services