helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zzh...@apache.org
Subject git commit: HELIX-36: reduce log.info message sizes in creating/closing a zkclient
Date Fri, 01 Feb 2013 21:52:54 GMT
Updated Branches:
  refs/heads/master c44a2badf -> 47d1e650e


HELIX-36: reduce log.info message sizes in creating/closing a zkclient


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

Branch: refs/heads/master
Commit: 47d1e650ebfd18a56ebdf00c23c2f736016aa0bb
Parents: c44a2ba
Author: zzhang <zzhang5@uci.edu>
Authored: Fri Feb 1 13:45:37 2013 -0800
Committer: zzhang <zzhang5@uci.edu>
Committed: Fri Feb 1 13:45:37 2013 -0800

----------------------------------------------------------------------
 .../java/org/apache/helix/manager/zk/ZkClient.java |   14 ++++++++------
 helix-core/src/test/resources/log4j.properties     |    2 +-
 2 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/47d1e650/helix-core/src/main/java/org/apache/helix/manager/zk/ZkClient.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/manager/zk/ZkClient.java b/helix-core/src/main/java/org/apache/helix/manager/zk/ZkClient.java
index 7047708..c52ffec 100644
--- a/helix-core/src/main/java/org/apache/helix/manager/zk/ZkClient.java
+++ b/helix-core/src/main/java/org/apache/helix/manager/zk/ZkClient.java
@@ -64,9 +64,11 @@ public class ZkClient extends org.I0Itec.zkclient.ZkClient
   {
     super(connection, connectionTimeout, new ByteArraySerializer());
     _zkSerializer = zkSerializer;
-    if(LOG.isTraceEnabled()){
+    if(LOG.isTraceEnabled())
+    {
       StackTraceElement[] calls = Thread.currentThread().getStackTrace();
-      LOG.info("create a new zkclient. " + Arrays.asList(calls));
+      int min = Math.min(calls.length, 5);
+      LOG.trace("creating a zkclient. callstack: " + Arrays.asList(calls).subList(0, min));
     }
   }
 
@@ -137,11 +139,11 @@ public class ZkClient extends org.I0Itec.zkclient.ZkClient
   @Override
   public void close() throws ZkInterruptedException
   {
-    if(LOG.isTraceEnabled()){
+    if(LOG.isTraceEnabled())
+    {
       StackTraceElement[] calls = Thread.currentThread().getStackTrace();
-      LOG.trace("closing a zkclient. zookeeper: "
-          + (_connection == null ? "null" : ((ZkConnection) _connection).getZookeeper())
-          + ", callStack: " + Arrays.asList(calls));
+      int min = Math.min(calls.length, 5);
+      LOG.trace("closing a zkclient. callStack: " + Arrays.asList(calls).subList(0, min));
     }
     super.close();
   }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/47d1e650/helix-core/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/helix-core/src/test/resources/log4j.properties b/helix-core/src/test/resources/log4j.properties
index 337dae2..24b6d10 100644
--- a/helix-core/src/test/resources/log4j.properties
+++ b/helix-core/src/test/resources/log4j.properties
@@ -38,4 +38,4 @@ log4j.logger.org.apache=ERROR
 log4j.logger.com.noelios=ERROR
 log4j.logger.org.restlet=ERROR
 
-log4j.logger.org.apache.helix.monitoring.ZKPathDataDumpTask=INFO,STATUSDUMP
+log4j.logger.org.apache.helix.monitoring.ZKPathDataDumpTask=ERROR,STATUSDUMP


Mime
View raw message