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 2022/01/19 01:47:09 UTC

[iotdb] branch WarningLog created (now ea87208)

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

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


      at ea87208  format code

This branch includes the following new commits:

     new 94db246  When opening too many file handlers, reduce warning logs print
     new ea87208  format code

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[iotdb] 01/02: When opening too many file handlers, reduce warning logs print

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 94db24685fae20e4aa8c03f6a95dfb8da8d1c030
Author: JackieTien97 <ja...@gmail.com>
AuthorDate: Wed Jan 19 09:45:43 2022 +0800

    When opening too many file handlers, reduce warning logs print
---
 .../org/apache/iotdb/db/query/control/FileReaderManager.java   | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/query/control/FileReaderManager.java b/server/src/main/java/org/apache/iotdb/db/query/control/FileReaderManager.java
index 0046bf0..c6418ce 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/control/FileReaderManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/control/FileReaderManager.java
@@ -46,6 +46,12 @@ public class FileReaderManager {
   private static final int MAX_CACHED_FILE_SIZE = 30000;
 
   /**
+   * When number of file streams reached MAX_CACHED_FILE_SIZE, then we will print a warning log each
+   * PRINT_INTERVAL
+   */
+  private static final int PRINT_INTERVAL = 10000;
+
+  /**
    * the key of closedFileReaderMap is the file path and the value of closedFileReaderMap is the
    * corresponding reader.
    */
@@ -108,8 +114,8 @@ public class FileReaderManager {
     Map<String, TsFileSequenceReader> readerMap =
         !isClosed ? unclosedFileReaderMap : closedFileReaderMap;
     if (!readerMap.containsKey(filePath)) {
-
-      if (readerMap.size() >= MAX_CACHED_FILE_SIZE) {
+      int currentOpenedReaderCount = readerMap.size();
+      if (currentOpenedReaderCount >= MAX_CACHED_FILE_SIZE && (currentOpenedReaderCount % PRINT_INTERVAL == 0)) {
         logger.warn("Query has opened {} files !", readerMap.size());
       }
 

[iotdb] 02/02: format code

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ea87208d84f77bc294bdc5b05dfbccf42ad0fe54
Author: JackieTien97 <ja...@gmail.com>
AuthorDate: Wed Jan 19 09:46:13 2022 +0800

    format code
---
 .../main/java/org/apache/iotdb/db/query/control/FileReaderManager.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/query/control/FileReaderManager.java b/server/src/main/java/org/apache/iotdb/db/query/control/FileReaderManager.java
index c6418ce..c53eb4c 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/control/FileReaderManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/control/FileReaderManager.java
@@ -115,7 +115,8 @@ public class FileReaderManager {
         !isClosed ? unclosedFileReaderMap : closedFileReaderMap;
     if (!readerMap.containsKey(filePath)) {
       int currentOpenedReaderCount = readerMap.size();
-      if (currentOpenedReaderCount >= MAX_CACHED_FILE_SIZE && (currentOpenedReaderCount % PRINT_INTERVAL == 0)) {
+      if (currentOpenedReaderCount >= MAX_CACHED_FILE_SIZE
+          && (currentOpenedReaderCount % PRINT_INTERVAL == 0)) {
         logger.warn("Query has opened {} files !", readerMap.size());
       }