Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 739B4200C15 for ; Wed, 8 Feb 2017 18:59:40 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 72819160B6A; Wed, 8 Feb 2017 17:59:40 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E916A160B6D for ; Wed, 8 Feb 2017 18:59:38 +0100 (CET) Received: (qmail 7581 invoked by uid 500); 8 Feb 2017 17:59:38 -0000 Mailing-List: contact commits-help@helix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@helix.apache.org Delivered-To: mailing list commits@helix.apache.org Received: (qmail 6601 invoked by uid 99); 8 Feb 2017 17:59:36 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2017 17:59:36 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DBBF0E04F2; Wed, 8 Feb 2017 17:59:36 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: lxia@apache.org To: commits@helix.apache.org Date: Wed, 08 Feb 2017 18:00:04 -0000 Message-Id: In-Reply-To: <32b42cc66e944930b3a0c348ce28033a@git.apache.org> References: <32b42cc66e944930b3a0c348ce28033a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [29/38] helix git commit: Log improvement: add resource name to logs in different places. archived-at: Wed, 08 Feb 2017 17:59:40 -0000 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 Authored: Mon Sep 19 10:20:01 2016 -0700 Committer: Lei Xia 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 keys = new ArrayList(); 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; }