Repository: hbase Updated Branches: refs/heads/0.98 fa7e0a646 -> 58e94d034
HBASE-12697 Don't use RegionLocationFinder if localityCost == 0 Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/58e94d03 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/58e94d03 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/58e94d03 Branch: refs/heads/0.98 Commit: 58e94d034ff6397ca068fdecf5dd54af582ca305 Parents: fa7e0a6 Author: Elliott Clark <[email protected]> Authored: Fri Dec 26 11:25:52 2014 -0800 Committer: Elliott Clark <[email protected]> Committed: Fri Dec 26 11:25:52 2014 -0800 ---------------------------------------------------------------------- .../hbase/master/balancer/StochasticLoadBalancer.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/58e94d03/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java index debbd9d..324a54d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java @@ -198,8 +198,17 @@ public class StochasticLoadBalancer extends BaseLoadBalancer { long startTime = EnvironmentEdgeManager.currentTimeMillis(); + // On clusters with lots of HFileLinks or lots of reference files, + // instantiating the storefile infos can be quite expensive. + // Allow turning this feature off if the locality cost is not going to + // be used in any computations. + RegionLocationFinder finder = null; + if (this.localityCost != null && this.localityCost.getMultiplier() > 0) { + finder = this.regionFinder; + } + // Keep track of servers to iterate through them. - Cluster cluster = new Cluster(clusterState, loads, regionFinder); + Cluster cluster = new Cluster(clusterState, loads, finder); double currentCost = computeCost(cluster, Double.MAX_VALUE); double initCost = currentCost;
