HBASE-6779 Fix issues analysis.apache.org raises about StochasticLoadBalancer
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1387372 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4bd1ffbd1e
commit
3067e60c39
|
@ -512,14 +512,14 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
|
|||
|
||||
// Now go through all of the tables we have seen and keep the max number
|
||||
// of regions of this table a single region server is hosting.
|
||||
for (String tableName : tableRegionsOnCurrentServer.keySet()) {
|
||||
Integer thisCount = tableRegionsOnCurrentServer.get(tableName).toInteger();
|
||||
for (Entry<String, MutableInt> currentServerEntry: tableRegionsOnCurrentServer.entrySet()) {
|
||||
String tableName = currentServerEntry.getKey();
|
||||
Integer thisCount = currentServerEntry.getValue().toInteger();
|
||||
Integer maxCountSoFar = tableCostSeenSoFar.get(tableName);
|
||||
|
||||
if (maxCountSoFar == null || thisCount.compareTo(maxCountSoFar) > 0) {
|
||||
tableCostSeenSoFar.put(tableName, thisCount);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -560,11 +560,6 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
|
|||
|
||||
max += 1;
|
||||
|
||||
// Only compute the data locality for moved regions.
|
||||
if (initialRegionMapping.equals(sn)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
List<ServerName> dataOnServers = regionFinder.getTopBlockLocations(region);
|
||||
|
||||
// If we can't find where the data is getTopBlock returns null.
|
||||
|
|
Loading…
Reference in New Issue