You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2021/04/26 05:09:20 UTC

[hbase] branch branch-2.4 updated: HBASE-25806 Backport the region location finder initialization fix in HBASE-25802 (#3196)

This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.4 by this push:
     new e765e19  HBASE-25806 Backport the region location finder initialization fix in HBASE-25802 (#3196)
e765e19 is described below

commit e765e19279c8f4a5a75ce7e57d75d4d7255215c0
Author: Duo Zhang <zh...@apache.org>
AuthorDate: Mon Apr 26 12:03:40 2021 +0800

    HBASE-25806 Backport the region location finder initialization fix in HBASE-25802 (#3196)
    
    Signed-off-by: Yulin Niu <ni...@apache.org>
---
 .../org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
index d925a79..b99c2d3 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
@@ -103,8 +103,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
    * The constructor that uses the basic MetricsBalancer
    */
   protected BaseLoadBalancer() {
-    metricsBalancer = new MetricsBalancer();
-    createRegionFinder();
+    this(null);
   }
 
   /**
@@ -1060,7 +1059,9 @@ public abstract class BaseLoadBalancer implements LoadBalancer {
     this.onlySystemTablesOnMaster = LoadBalancer.isSystemTablesOnlyOnMaster(this.config);
 
     this.rackManager = new RackManager(getConf());
+    useRegionFinder = config.getBoolean("hbase.master.balancer.uselocality", true);
     if (useRegionFinder) {
+      regionFinder = new RegionLocationFinder();
       regionFinder.setConf(conf);
     }
     this.isByTable = conf.getBoolean(HConstants.HBASE_MASTER_LOADBALANCE_BYTABLE, isByTable);