HBASE-25806 Backport the region location finder initialization fix in HBASE-25802 (#3196)

Signed-off-by: Yulin Niu <niuyulin@apache.org>
This commit is contained in:
Duo Zhang 2021-04-26 12:03:40 +08:00
parent 1dc881ab85
commit e765e19279
1 changed files with 3 additions and 2 deletions

View File

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