HBASE-12762 Region with no hfiles will have the highest locality cost in LocalityCostFunction (cuijianwei)

This commit is contained in:
stack 2014-12-29 07:44:46 -08:00
parent fbdaf62bf8
commit 8dac7f9e6c
1 changed files with 3 additions and 1 deletions

View File

@ -1026,7 +1026,9 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
}
if (index < 0) {
cost += 1;
if (regionLocations.length > 0) {
cost += 1;
}
} else {
cost += (double) index / (double) regionLocations.length;
}