helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject [29/38] helix git commit: Log improvement: add resource name to logs in different places.
Date Wed, 08 Feb 2017 18:00:04 GMT
Log improvement: add resource name to logs in different places.


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

Branch: refs/heads/helix-0.6.x
Commit: 3f07be0f87f7796238c1e8041fb4f5d96d907f4f
Parents: b0d1122
Author: Lei Xia <lxia@linkedin.com>
Authored: Mon Sep 19 10:20:01 2016 -0700
Committer: Lei Xia <lxia@linkedin.com>
Committed: Wed Feb 8 09:53:48 2017 -0800

----------------------------------------------------------------------
 .../stages/MessageGenerationPhase.java          | 22 +++++++++++---------
 .../controller/stages/MessageThrottleStage.java |  1 -
 .../controller/stages/TaskAssignmentStage.java  |  8 ++++---
 .../java/org/apache/helix/model/IdealState.java |  3 ++-
 4 files changed, 19 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/3f07be0f/helix-core/src/main/java/org/apache/helix/controller/stages/MessageGenerationPhase.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/MessageGenerationPhase.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/MessageGenerationPhase.java
index 63096bb..c1aa2a4 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/MessageGenerationPhase.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/MessageGenerationPhase.java
@@ -103,8 +103,8 @@ public class MessageGenerationPhase extends AbstractBaseStage {
 
           String nextState = stateModelDef.getNextStateForTransition(currentState, desiredState);
           if (nextState == null) {
-            logger.error("Unable to find a next state for partition: "
-                + partition.getPartitionName() + " from stateModelDefinition"
+            logger.error("Unable to find a next state for resource: " + resource.getResourceName()
+                + " partition: " + partition.getPartitionName() + " from stateModelDefinition"
                 + stateModelDef.getClass() + " from:" + currentState + " to:" + desiredState);
             continue;
           }
@@ -112,16 +112,18 @@ public class MessageGenerationPhase extends AbstractBaseStage {
           if (pendingMessage != null) {
             String pendingState = pendingMessage.getToState();
             if (nextState.equalsIgnoreCase(pendingState)) {
-              logger.debug("Message already exists for " + instanceName + " to transit "
-                  + partition.getPartitionName() + " from " + currentState + " to " + nextState);
+              logger.debug("Message already exists for " + instanceName + " to transit "
+ resource
+                  .getResourceName() + "." + partition.getPartitionName() + " from " + currentState
+                  + " to " + nextState);
             } else if (currentState.equalsIgnoreCase(pendingState)) {
-              logger.info("Message hasn't been removed for " + instanceName + " to transit"
-                  + partition.getPartitionName() + " to " + pendingState + ", desiredState:
"
-                  + desiredState);
+              logger.info("Message hasn't been removed for " + instanceName + " to transit
" +
+                  resource.getResourceName() + "." + partition.getPartitionName() + " to
"
+                      + pendingState + ", desiredState: " + desiredState);
             } else {
-              logger.info("IdealState changed before state transition completes for "
-                  + partition.getPartitionName() + " on " + instanceName + ", pendingState:
"
-                  + pendingState + ", currentState: " + currentState + ", nextState: " +
nextState);
+              logger.info("IdealState changed before state transition completes for " +
+                  resource.getResourceName() + "." + partition.getPartitionName() + " on
"
+                      + instanceName + ", pendingState: " + pendingState + ", currentState:
"
+                      + currentState + ", nextState: " + nextState);
             }
           } else {
 

http://git-wip-us.apache.org/repos/asf/helix/blob/3f07be0f/helix-core/src/main/java/org/apache/helix/controller/stages/MessageThrottleStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/MessageThrottleStage.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/MessageThrottleStage.java
index 9eea7f1..6bf610a 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/MessageThrottleStage.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/MessageThrottleStage.java
@@ -179,7 +179,6 @@ public class MessageThrottleStage extends AbstractBaseStage {
           }
         }
       }
-
       if (!msgThrottled) {
         throttleOutputMsgs.add(message);
       }

http://git-wip-us.apache.org/repos/asf/helix/blob/3f07be0f/helix-core/src/main/java/org/apache/helix/controller/stages/TaskAssignmentStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/TaskAssignmentStage.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/TaskAssignmentStage.java
index 85ca4cf..c466bc6 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/TaskAssignmentStage.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/TaskAssignmentStage.java
@@ -140,9 +140,11 @@ public class TaskAssignmentStage extends AbstractBaseStage {
 
     List<PropertyKey> keys = new ArrayList<PropertyKey>();
     for (Message message : messages) {
-      logger.info("Sending Message " + message.getMsgId() + " to " + message.getTgtName()
-          + " transit " + message.getPartitionName() + "|" + message.getPartitionNames()
+ " from:"
-          + message.getFromState() + " to:" + message.getToState());
+      logger.info(
+          "Sending Message " + message.getMsgId() + " to " + message.getTgtName() + " transit
"
+              + message.getResourceName() + "." + message.getPartitionName() + "|" + message
+              .getPartitionNames() + " from:" + message.getFromState() + " to:" + message
+              .getToState());
 
       keys.add(keyBuilder.message(message.getTgtName(), message.getId()));
     }

http://git-wip-us.apache.org/repos/asf/helix/blob/3f07be0f/helix-core/src/main/java/org/apache/helix/model/IdealState.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/model/IdealState.java b/helix-core/src/main/java/org/apache/helix/model/IdealState.java
index ab46f94..769a369 100644
--- a/helix-core/src/main/java/org/apache/helix/model/IdealState.java
+++ b/helix-core/src/main/java/org/apache/helix/model/IdealState.java
@@ -390,7 +390,8 @@ public class IdealState extends HelixProperty {
     if (instanceStateList != null) {
       return instanceStateList;
     }
-    logger.warn("Resource key:" + partitionName + " does not have a pre-computed preference
list.");
+    logger.warn("Resource: " + getResourceName() + " key:" + partitionName
+        + " does not have a pre-computed preference list.");
     return null;
   }
 


Mime
View raw message