You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2023/05/24 02:22:55 UTC

[iotdb] branch master updated: [IOTDB-5914] Remove redundant debug log in Session

This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 5b83ed50c32 [IOTDB-5914] Remove redundant debug log in Session
5b83ed50c32 is described below

commit 5b83ed50c329ea8b6c22508fd0cb29c5b937af07
Author: Haonan <hh...@outlook.com>
AuthorDate: Wed May 24 10:22:50 2023 +0800

    [IOTDB-5914] Remove redundant debug log in Session
---
 .../java/org/apache/iotdb/rpc/AutoResizingBuffer.java    |  3 ---
 .../src/main/java/org/apache/iotdb/session/Session.java  |  7 -------
 .../java/org/apache/iotdb/session/pool/SessionPool.java  | 16 ----------------
 3 files changed, 26 deletions(-)

diff --git a/service-rpc/src/main/java/org/apache/iotdb/rpc/AutoResizingBuffer.java b/service-rpc/src/main/java/org/apache/iotdb/rpc/AutoResizingBuffer.java
index 134c41bcadc..93a154e84b4 100644
--- a/service-rpc/src/main/java/org/apache/iotdb/rpc/AutoResizingBuffer.java
+++ b/service-rpc/src/main/java/org/apache/iotdb/rpc/AutoResizingBuffer.java
@@ -56,8 +56,6 @@ class AutoResizingBuffer {
       int newCapacity = Math.max(growCapacity, size);
       this.array = Arrays.copyOf(array, newCapacity);
       bufTooLargeCounter = RpcUtils.MAX_BUFFER_OVERSIZE_TIME;
-      logger.debug(
-          "{} expand from {} to {}, request: {}", this, currentCapacity, newCapacity, size);
     } else if (size > initialCapacity
         && currentCapacity * loadFactor > size
         && bufTooLargeCounter-- <= 0
@@ -66,7 +64,6 @@ class AutoResizingBuffer {
       array = Arrays.copyOf(array, size + (currentCapacity - size) / 2);
       bufTooLargeCounter = RpcUtils.MAX_BUFFER_OVERSIZE_TIME;
       lastShrinkTime = System.currentTimeMillis();
-      logger.debug("{} shrink from {} to {}", this, currentCapacity, size);
     }
   }
 
diff --git a/session/src/main/java/org/apache/iotdb/session/Session.java b/session/src/main/java/org/apache/iotdb/session/Session.java
index 1ed59f5d0d0..76f290e8448 100644
--- a/session/src/main/java/org/apache/iotdb/session/Session.java
+++ b/session/src/main/java/org/apache/iotdb/session/Session.java
@@ -741,16 +741,10 @@ public class Session implements ISession {
   private SessionDataSet executeStatementMayRedirect(String sql, long timeoutInMs)
       throws StatementExecutionException, IoTDBConnectionException {
     try {
-      logger.debug("{} execute sql {}", defaultSessionConnection.getEndPoint(), sql);
       return defaultSessionConnection.executeQueryStatement(sql, timeoutInMs);
     } catch (RedirectException e) {
       handleQueryRedirection(e.getEndPoint());
       if (enableQueryRedirection) {
-        logger.debug(
-            "{} redirect query {} to {}",
-            defaultSessionConnection.getEndPoint(),
-            sql,
-            e.getEndPoint());
         // retry
         try {
           return defaultSessionConnection.executeQueryStatement(sql, queryTimeoutInMs);
@@ -795,7 +789,6 @@ public class Session implements ISession {
     } catch (RedirectException e) {
       handleQueryRedirection(e.getEndPoint());
       if (enableQueryRedirection) {
-        logger.debug("redirect query {} to {}", paths, e.getEndPoint());
         // retry
         try {
           return defaultSessionConnection.executeRawDataQuery(paths, startTime, endTime, timeOut);
diff --git a/session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java b/session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java
index 61a99e71f53..e51567c8be8 100644
--- a/session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java
+++ b/session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java
@@ -415,9 +415,6 @@ public class SessionPool implements ISessionPool {
 
         // we have to wait for someone returns a session.
         try {
-          if (logger.isDebugEnabled()) {
-            logger.debug("no more sessions can be created, wait... queue.size={}", queue.size());
-          }
           this.wait(1000);
           long timeOut = Math.min(waitToGetSessionTimeoutInMs, 60_000);
           if (System.currentTimeMillis() - start > timeOut) {
@@ -454,13 +451,6 @@ public class SessionPool implements ISessionPool {
 
     if (shouldCreate) {
       // create a new one.
-      if (logger.isDebugEnabled()) {
-        if (nodeUrls == null) {
-          logger.debug("Create a new Session {}, {}, {}, {}", host, port, user, password);
-        } else {
-          logger.debug("Create a new redirect Session {}, {}, {}", nodeUrls, user, password);
-        }
-      }
 
       session = constructNewSession();
 
@@ -481,9 +471,6 @@ public class SessionPool implements ISessionPool {
           size--;
           // we do not need to notifyAll as any waited thread can continue to work after waked up.
           this.notify();
-          if (logger.isDebugEnabled()) {
-            logger.debug("open session failed, reduce the count and notify others...");
-          }
         }
         throw e;
       }
@@ -581,9 +568,6 @@ public class SessionPool implements ISessionPool {
         size--;
         // we do not need to notifyAll as any waited thread can continue to work after waked up.
         this.notify();
-        if (logger.isDebugEnabled()) {
-          logger.debug("open session failed, reduce the count and notify others...");
-        }
       }
     }
   }