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_r331448761
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
 ##########
 @@ -348,9 +348,10 @@ protected boolean needsBalance(Cluster cluster) {
     if (total <= 0 || sumMultiplier <= 0
         || (sumMultiplier > 0 && (total / sumMultiplier) < 
minCostNeedBalance)) {
       if (LOG.isTraceEnabled()) {
-        LOG.trace("Skipping load balancing because balanced cluster; " + 
"total cost is " + total
-          + ", sum multiplier is " + sumMultiplier + " min cost which need 
balance is "
-          + minCostNeedBalance);
+        final String loadBalanceTarget = isByTable ? String.format("table 
(%s)", tableName) : "cluster";
 
 Review comment:
   Definitely keeping it as a variable is fine. I just thought it would be 
better to keep loadBalanceTarget out of `LOG.isTraceEnabled()` since usually we 
want only `LOG.trace()` to be covered by it. 
   Anyways, keeping it unchanged is fine as per your suggestion. Just one liner 
conditional execution within if condition.

----------------------------------------------------------------
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

Reply via email to