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

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


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

commit 351b4cf53213af0bc21c863d484bc6547070fe6c
Author: Duo Zhang <[email protected]>
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 <[email protected]>
---
 .../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 75a8978..b9585b5 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
@@ -99,8 +99,7 @@ public abstract class BaseLoadBalancer implements 
LoadBalancer {
    * The constructor that uses the basic MetricsBalancer
    */
   protected BaseLoadBalancer() {
-    metricsBalancer = new MetricsBalancer();
-    createRegionFinder();
+    this(null);
   }
 
   /**
@@ -1052,7 +1051,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);

Reply via email to