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 <[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 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);