You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2021/07/22 09:15:26 UTC

[iotdb] branch autoai_debug_single updated: daemon true, remove static

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

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


The following commit(s) were added to refs/heads/autoai_debug_single by this push:
     new 1346110  daemon true, remove static
1346110 is described below

commit 1346110ecaf848a90d8e2f928ccd310267a0a375
Author: HTHou <hh...@outlook.com>
AuthorDate: Thu Jul 22 17:14:47 2021 +0800

    daemon true, remove static
---
 .../apache/iotdb/db/engine/storagegroup/TsFileProcessor.java | 12 ++++++------
 .../apache/iotdb/db/writelog/node/ExclusiveWriteLogNode.java |  7 ++++---
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
index b54f5bd..2b9dd63 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
@@ -253,17 +253,17 @@ public class TsFileProcessor {
     }
     try {
       workMemTable.insertTablet(insertTabletPlan, start, end);
-      long startTime = System.currentTimeMillis();
+      //      long startTime = System.currentTimeMillis();
       if (IoTDBDescriptor.getInstance().getConfig().isEnableWal()) {
         insertTabletPlan.setStart(start);
         insertTabletPlan.setEnd(end);
         getLogNode().write(insertTabletPlan);
       }
-      long elapsed = System.currentTimeMillis() - startTime;
-
-      if (elapsed > 3000) {
-        logger.error("write wal slowly : cost {}ms", elapsed);
-      }
+      //      long elapsed = System.currentTimeMillis() - startTime;
+      //
+      //      if (elapsed > 3000) {
+      //        logger.error("write wal slowly : cost {}ms", elapsed);
+      //      }
     } catch (Exception e) {
       for (int i = start; i < end; i++) {
         results[i] = RpcUtils.getStatus(TSStatusCode.INTERNAL_SERVER_ERROR, e.getMessage());
diff --git a/server/src/main/java/org/apache/iotdb/db/writelog/node/ExclusiveWriteLogNode.java b/server/src/main/java/org/apache/iotdb/db/writelog/node/ExclusiveWriteLogNode.java
index 5fe22db..674cfc2 100644
--- a/server/src/main/java/org/apache/iotdb/db/writelog/node/ExclusiveWriteLogNode.java
+++ b/server/src/main/java/org/apache/iotdb/db/writelog/node/ExclusiveWriteLogNode.java
@@ -68,9 +68,9 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
 
   private final Object switchBufferCondition = new Object();
   private ReentrantLock lock = new ReentrantLock();
-  private static final ExecutorService FLUSH_BUFFER_THREAD_POOL =
+  private final ExecutorService FLUSH_BUFFER_THREAD_POOL =
       Executors.newCachedThreadPool(
-          new ThreadFactoryBuilder().setNameFormat("Flush-WAL-Thread-%d").setDaemon(false).build());
+          new ThreadFactoryBuilder().setNameFormat("Flush-WAL-Thread-%d").setDaemon(true).build());
 
   private long fileId = 0;
   private long lastFlushedId = 0;
@@ -270,6 +270,7 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
       }
       switchBufferWorkingToFlushing();
       ILogWriter currWriter = getCurrentFileWriter();
+      logger.warn("[wal] {} submit start", this.hashCode());
       FLUSH_BUFFER_THREAD_POOL.submit(() -> flushBuffer(currWriter));
       switchBufferIdleToWorking();
 
@@ -287,7 +288,7 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
   }
 
   private void flushBuffer(ILogWriter writer) {
-    //    logger.warn("[wal] {} flushBuffer start", this.hashCode());
+    logger.warn("[wal] {} flushBuffer start", this.hashCode());
     //    long start = System.currentTimeMillis();
     try {
       writer.write(logBufferFlushing);