HBASE-12762 Region with no hfiles will have the highest locality cost in LocalityCostFunction (cuijianwei)
This commit is contained in:
parent
fbdaf62bf8
commit
8dac7f9e6c
|
@ -1026,7 +1026,9 @@ public class StochasticLoadBalancer extends BaseLoadBalancer {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
cost += 1;
|
if (regionLocations.length > 0) {
|
||||||
|
cost += 1;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
cost += (double) index / (double) regionLocations.length;
|
cost += (double) index / (double) regionLocations.length;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue