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 it out of `LOG.isTraceEnabled()` since usually we want only `LOG.trace()` to be covered by it. But anyways, keeping it unchanged is fine, it's just used by trace log. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services