diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java index f02ef1dd3c8..30818119dbb 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java @@ -397,7 +397,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer { float average = cs.getLoadAverage(); // for logging int floor = (int) Math.floor(average * (1 - slop)); int ceiling = (int) Math.ceil(average * (1 + slop)); - if (!(cs.getMinLoad() > ceiling || cs.getMaxLoad() < floor)) { + if (!(cs.getMaxLoad() > ceiling || cs.getMinLoad() < floor)) { NavigableMap> serversByLoad = cs.getServersByLoad(); if (LOG.isTraceEnabled()) { // If nothing to balance, then don't say anything unless trace-level logging. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/ClusterLoadState.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/ClusterLoadState.java index 9bf4b59b49e..64c1921cd75 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/ClusterLoadState.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/ClusterLoadState.java @@ -75,11 +75,11 @@ public class ClusterLoadState { return (float) numRegions / numServers; } - int getMinLoad() { + int getMaxLoad() { return getServersByLoad().lastKey().getLoad(); } - int getMaxLoad() { + int getMinLoad() { return getServersByLoad().firstKey().getLoad(); }