virajjasani commented on a change in pull request #687: HBASE-23116: Fix a
couple of load balancer logging nits.
URL: https://github.com/apache/hbase/pull/687#discussion_r331358308
##########
File path:
hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancer.java
##########
@@ -242,15 +236,24 @@ public void testKeepRegionLoad() throws Exception {
public void testNeedBalance() {
float minCost =
conf.getFloat("hbase.master.balancer.stochastic.minCostNeedBalance", 0.05f);
conf.setFloat("hbase.master.balancer.stochastic.minCostNeedBalance", 1.0f);
- loadBalancer.setConf(conf);
- for (int[] mockCluster : clusterStateMocks) {
- Map<ServerName, List<RegionInfo>> servers =
mockClusterServers(mockCluster);
- List<RegionPlan> plans = loadBalancer.balanceCluster(servers);
- assertNull(plans);
+ try {
+ // Test with/without per table balancer.
+ boolean[] perTableBalancerConfigs = {true, false};
+ for (boolean isByTable : perTableBalancerConfigs) {
+ conf.setBoolean(HConstants.HBASE_MASTER_LOADBALANCE_BYTABLE,
isByTable);
+ loadBalancer.setConf(conf);
+ for (int[] mockCluster : clusterStateMocks) {
+ Map<ServerName, List<RegionInfo>> servers =
mockClusterServers(mockCluster);
+ List<RegionPlan> plans = loadBalancer.balanceCluster(servers);
+ assertNull(plans);
+ }
+ }
+ } finally {
+ // reset config
+ conf.setBoolean(HConstants.HBASE_MASTER_LOADBALANCE_BYTABLE, false);
Review comment:
if intention is to revert applied configs, we can unset this config
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services