HBASE-4694 Addendum, revert non-logging statements in DefaultLoadBalancer

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1190747 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2011-10-29 03:35:05 +00:00
parent 99a5df9b64
commit 2b021bce11
1 changed files with 8 additions and 1 deletions

View File

@ -229,7 +229,14 @@ public class DefaultLoadBalancer implements LoadBalancer {
NavigableMap<ServerAndLoad, List<HRegionInfo>> serversByLoad =
new TreeMap<ServerAndLoad, List<HRegionInfo>>();
int numRegions = 0;
// Iterate so we can count regions as we build the map
for (Map.Entry<ServerName, List<HRegionInfo>> server: clusterState.entrySet()) {
List<HRegionInfo> regions = server.getValue();
int sz = regions.size();
if (sz == 0) emptyRegionServerPresent = true;
numRegions += sz;
serversByLoad.put(new ServerAndLoad(server.getKey(), sz), regions);
}
// Check if we even need to do any load balancing
float average = (float)numRegions / numServers; // for logging
// HBASE-3681 check sloppiness first