Skip to content

Commit d7849df

Browse files
committed
pr review feedback
1 parent a456b01 commit d7849df

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,9 @@ public static double scale(double min, double max, double value) {
576576
if (max <= min || value <= min) {
577577
return 0;
578578
}
579-
if ((max - min) == 0) return 0;
579+
if ((max - min) == 0) {
580+
return 0;
581+
}
580582

581583
return Math.max(0d, Math.min(1d, (value - min) / (max - min)));
582584
}

hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,8 @@ protected void regionMoved(int region, int oldServer, int newServer) {
821821
*
822822
* @param stats the costs
823823
* @return a scaled set of costs.
824-
*/ protected double costFromArray(double[] stats) {
824+
*/
825+
protected double costFromArray(double[] stats) {
825826
double totalCost = 0;
826827
double total = getSum(stats);
827828

@@ -830,7 +831,7 @@ protected void regionMoved(int region, int oldServer, int newServer) {
830831

831832
for (int i = 0; i < stats.length; i++) {
832833
double n = stats[i];
833-
double diff = Math.abs(mean - n) ;
834+
double diff = Math.abs(mean - n);
834835
totalCost += diff;
835836
}
836837

0 commit comments

Comments
 (0)