huaxiangsun commented on a change in pull request #3724:
URL: https://github.com/apache/hbase/pull/3724#discussion_r736775723
##########
File path:
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/DoubleArrayCost.java
##########
@@ -98,12 +98,13 @@ public static double getMinSkew(double total, double
numServers) {
// It's possible that there aren't enough regions to go around
double min;
if (numServers > total) {
- min = ((numServers - total) * mean + (1 - mean) * total) ;
+ min = ((numServers - total) * mean * mean + (1 - mean) * (1 - mean) *
total) ;
} else {
// Some will have 1 more than everything else.
int numHigh = (int) (total - (Math.floor(mean) * numServers));
int numLow = (int) (numServers - numHigh);
- min = numHigh * (Math.ceil(mean) - mean) + numLow * (mean -
Math.floor(mean));
+ min = numHigh * (Math.ceil(mean) - mean) * (Math.ceil(mean) - mean) +
Review comment:
Same for rest of the square calculation.
--
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]