helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject [2/2] helix git commit: Make logs are not printed with empty list in intermediate stage
Date Thu, 08 Mar 2018 23:12:51 GMT
Make logs are not printed with empty list in intermediate stage


Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/5f142f2e
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/5f142f2e
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/5f142f2e

Branch: refs/heads/master
Commit: 5f142f2ec7dcf718111bbc9e94eb83d7689428f0
Parents: 5c5186b
Author: Junkai Xue <jxue@linkedin.com>
Authored: Fri Feb 2 13:52:50 2018 -0800
Committer: Lei Xia <lxia@linkedin.com>
Committed: Thu Mar 8 15:00:14 2018 -0800

----------------------------------------------------------------------
 .../stages/IntermediateStateCalcStage.java        | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/5f142f2e/helix-core/src/main/java/org/apache/helix/controller/stages/IntermediateStateCalcStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/IntermediateStateCalcStage.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/IntermediateStateCalcStage.java
index 0352bb1..047cc9b 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/IntermediateStateCalcStage.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/IntermediateStateCalcStage.java
@@ -238,12 +238,18 @@ public class IntermediateStateCalcStage extends AbstractBaseStage {
       }
     }
 
-    logger.info(
-        "recovery balance needed for " + resourceName + " partitions: " + partitionsNeedRecovery);
-    logger.info(
-        "load balance needed for " + resourceName + " partitions: " + partitionsNeedLoadbalance);
-    logger.info("partition currently has ERROR replica in " + resourceName + " partitions:
"
-        + partitionshaveErrorStateReplica);
+    if (!partitionsNeedRecovery.isEmpty()) {
+      logger.info(
+          "recovery balance needed for " + resourceName + " partitions: " + partitionsNeedRecovery);
+    }
+    if (!partitionsNeedLoadbalance.isEmpty()) {
+      logger.info(
+          "load balance needed for " + resourceName + " partitions: " + partitionsNeedLoadbalance);
+    }
+    if (!partitionshaveErrorStateReplica.isEmpty()) {
+      logger.info("partition currently has ERROR replica in " + resourceName + " partitions:
"
+          + partitionshaveErrorStateReplica);
+    }
 
     chargePendingTransition(resource, currentStateOutput, throttleController,
         partitionsNeedRecovery, partitionsNeedLoadbalance);


Mime
View raw message