saintstack commented on a change in pull request #3356:
URL: https://github.com/apache/hbase/pull/3356#discussion_r646046394



##########
File path: 
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
##########
@@ -343,15 +343,15 @@ boolean needsBalance(TableName tableName, 
BalancerClusterState cluster) {
       sendRejectionReasonToRingBuffer(() -> getBalanceReason(calculatedTotal, 
calculatedMultiplier),
         costFunctions);
     }
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("{} {}; total cost={}, sum multiplier={}; cost/multiplier to 
need a balance is {}",
-          balanced ? "Skipping load balancing because balanced" : "We need to 
load balance",
-          isByTable ? String.format("table (%s)", tableName) : "cluster",
-          total, sumMultiplier, minCostNeedBalance);
-      if (LOG.isTraceEnabled()) {
-        LOG.trace("Balance decision detailed function costs={}", 
functionCost());
-      }
+    LOG.info("{} {}; total cost={}, sum multiplier={}; cost/multiplier to need 
a balance is {}",
+      balanced ? "Skipping load balancing because balanced" :
+        "Start calculating moving plan without logging info for up to {} secs",

Review comment:
       Should be "Calculating plan. May take up to {} seconds to complete."

##########
File path: 
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
##########
@@ -343,15 +343,15 @@ boolean needsBalance(TableName tableName, 
BalancerClusterState cluster) {
       sendRejectionReasonToRingBuffer(() -> getBalanceReason(calculatedTotal, 
calculatedMultiplier),
         costFunctions);
     }
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("{} {}; total cost={}, sum multiplier={}; cost/multiplier to 
need a balance is {}",
-          balanced ? "Skipping load balancing because balanced" : "We need to 
load balance",
-          isByTable ? String.format("table (%s)", tableName) : "cluster",
-          total, sumMultiplier, minCostNeedBalance);
-      if (LOG.isTraceEnabled()) {
-        LOG.trace("Balance decision detailed function costs={}", 
functionCost());
-      }
+    LOG.info("{} {}; total cost={}, sum multiplier={}; cost/multiplier to need 
a balance is {}",
+      balanced ? "Skipping load balancing because balanced" :
+        "Start calculating moving plan without logging info for up to {} secs",
+      isByTable ? String.format("table (%s)", tableName) : "cluster",

Review comment:
       This string is a little confusing... We are balancing by table or by 
cluster?  Should this fact be in the previous string?... "Calculating a plan 
for table=TABLENAME.... " or Calculating a plan for the full cluster..." Think 
of the poor operator reading the log message.

##########
File path: 
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
##########
@@ -470,17 +470,17 @@ private long calculateMaxSteps(BalancerClusterState 
cluster) {
     updateStochasticCosts(tableName, curOverallCost, curFunctionCosts);
     if (initCost > currentCost) {
       List<RegionPlan> plans = createRegionPlans(cluster);
-      LOG.info("Finished computing new load balance plan. Computation took {}" 
+
-        " to try {} different iterations.  Found a solution that moves " +
-        "{} regions; Going from a computed cost of {}" +
-        " to a new cost of {}", java.time.Duration.ofMillis(endTime - 
startTime),
-        step, plans.size(), initCost, currentCost);
+      LOG.info("Finished computing new load balance plan. Computation took {} 
ms" +

Review comment:
       We should name what we did here the same as what it was called in the 
start message. Here it is 'new load balance plan'. In the start log it is a 
'moving plan'.

##########
File path: 
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
##########
@@ -470,17 +470,17 @@ private long calculateMaxSteps(BalancerClusterState 
cluster) {
     updateStochasticCosts(tableName, curOverallCost, curFunctionCosts);
     if (initCost > currentCost) {
       List<RegionPlan> plans = createRegionPlans(cluster);
-      LOG.info("Finished computing new load balance plan. Computation took {}" 
+
-        " to try {} different iterations.  Found a solution that moves " +
-        "{} regions; Going from a computed cost of {}" +
-        " to a new cost of {}", java.time.Duration.ofMillis(endTime - 
startTime),
-        step, plans.size(), initCost, currentCost);
+      LOG.info("Finished computing new load balance plan. Computation took {} 
ms" +
+          " to try {} different iterations.  Found a solution that moves " +
+          "{} regions; Going from a computed cost of {}" +
+          " to a new cost of {}. Move plan to be submitted to master to 
execute",

Review comment:
       Rather than 'move plan to be submitted...' just say 'Executing plan'.
   
   Its called 'cost' but is that the right term? Is it our assessment of 
'balance'?

##########
File path: 
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
##########
@@ -470,17 +470,17 @@ private long calculateMaxSteps(BalancerClusterState 
cluster) {
     updateStochasticCosts(tableName, curOverallCost, curFunctionCosts);
     if (initCost > currentCost) {
       List<RegionPlan> plans = createRegionPlans(cluster);
-      LOG.info("Finished computing new load balance plan. Computation took {}" 
+
-        " to try {} different iterations.  Found a solution that moves " +
-        "{} regions; Going from a computed cost of {}" +
-        " to a new cost of {}", java.time.Duration.ofMillis(endTime - 
startTime),
-        step, plans.size(), initCost, currentCost);
+      LOG.info("Finished computing new load balance plan. Computation took {} 
ms" +
+          " to try {} different iterations.  Found a solution that moves " +
+          "{} regions; Going from a computed cost of {}" +
+          " to a new cost of {}. Move plan to be submitted to master to 
execute",
+        endTime - startTime, step, plans.size(), initCost, currentCost);
       sendRegionPlansToRingBuffer(plans, currentCost, initCost, 
initFunctionTotalCosts, step);
       return plans;
     }
     LOG.info("Could not find a better load balance plan.  Tried {} different 
configurations in " +

Review comment:
       Should be named same here as in start log.

##########
File path: 
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
##########
@@ -343,15 +343,15 @@ boolean needsBalance(TableName tableName, 
BalancerClusterState cluster) {
       sendRejectionReasonToRingBuffer(() -> getBalanceReason(calculatedTotal, 
calculatedMultiplier),
         costFunctions);
     }
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("{} {}; total cost={}, sum multiplier={}; cost/multiplier to 
need a balance is {}",
-          balanced ? "Skipping load balancing because balanced" : "We need to 
load balance",
-          isByTable ? String.format("table (%s)", tableName) : "cluster",
-          total, sumMultiplier, minCostNeedBalance);
-      if (LOG.isTraceEnabled()) {
-        LOG.trace("Balance decision detailed function costs={}", 
functionCost());
-      }
+    LOG.info("{} {}; total cost={}, sum multiplier={}; cost/multiplier to need 
a balance is {}",

Review comment:
       What is cost? And multiplier? And how do the relate to whether a cluster 
is balanced or not?

##########
File path: 
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
##########
@@ -343,15 +343,15 @@ boolean needsBalance(TableName tableName, 
BalancerClusterState cluster) {
       sendRejectionReasonToRingBuffer(() -> getBalanceReason(calculatedTotal, 
calculatedMultiplier),
         costFunctions);
     }
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("{} {}; total cost={}, sum multiplier={}; cost/multiplier to 
need a balance is {}",
-          balanced ? "Skipping load balancing because balanced" : "We need to 
load balance",
-          isByTable ? String.format("table (%s)", tableName) : "cluster",
-          total, sumMultiplier, minCostNeedBalance);
-      if (LOG.isTraceEnabled()) {
-        LOG.trace("Balance decision detailed function costs={}", 
functionCost());
-      }
+    LOG.info("{} {}; total cost={}, sum multiplier={}; cost/multiplier to need 
a balance is {}",
+      balanced ? "Skipping load balancing because balanced" :

Review comment:
       If balanced, shouldn't it say why it thinks its balanced?




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


Reply via email to