Skip to content

Commit

Permalink
HBASE-25806 Backport the region location finder initialization fix in H…
Browse files Browse the repository at this point in the history
…BASE-25802 (#3196)

Signed-off-by: Yulin Niu <niuyulin@apache.org>
  • Loading branch information
Apache9 committed Apr 26, 2021
1 parent 1dc881a commit e765e19
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ public String getRack(ServerName server) {
* The constructor that uses the basic MetricsBalancer
*/
protected BaseLoadBalancer() {
metricsBalancer = new MetricsBalancer();
createRegionFinder();
this(null);
}

/**
Expand Down Expand Up @@ -1060,7 +1059,9 @@ public void setConf(Configuration conf) {
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);
Expand Down

0 comments on commit e765e19

Please sign in to comment.