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/21 10:22:06 UTC

[iotdb] branch autoai_debug_single updated (d468b89 -> 01a50ab)

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

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


    from d468b89  reduce log
     new 88f7b81  change pool and remove log
     new 01a50ab  spotless

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.


Summary of changes:
 .../db/writelog/node/ExclusiveWriteLogNode.java    | 36 ++++++++++------------
 1 file changed, 17 insertions(+), 19 deletions(-)

[iotdb] 01/02: change pool and remove log

Posted by ha...@apache.org.
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

commit 88f7b8130bc32b5bce660a236d8dbdfa203b4004
Author: HTHou <hh...@outlook.com>
AuthorDate: Wed Jul 21 18:20:00 2021 +0800

    change pool and remove log
---
 .../db/writelog/node/ExclusiveWriteLogNode.java    | 36 ++++++++++------------
 1 file changed, 17 insertions(+), 19 deletions(-)

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 e9f3754..57d8c15 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
@@ -28,7 +28,6 @@ import org.apache.iotdb.db.writelog.io.ILogWriter;
 import org.apache.iotdb.db.writelog.io.LogWriter;
 import org.apache.iotdb.db.writelog.io.MultiFileLogReader;
 
-import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import org.apache.commons.io.FileUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -68,9 +67,8 @@ 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 =
-      Executors.newCachedThreadPool(
-          new ThreadFactoryBuilder().setNameFormat("Flush-WAL-Thread-%d").setDaemon(true).build());
+  private final ExecutorService FLUSH_BUFFER_THREAD_POOL =
+      Executors.newSingleThreadExecutor(r -> new Thread(r, "Flush-WAL-Thread-" + this.hashCode()));
 
   private long fileId = 0;
   private long lastFlushedId = 0;
@@ -316,7 +314,7 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
 
   private void switchBufferWorkingToFlushing() throws InterruptedException {
     //    logger.warn("[wal] {} switchBufferWorkingToFlushing start", this.hashCode());
-    long start = System.currentTimeMillis();
+    //long start = System.currentTimeMillis();
     synchronized (switchBufferCondition) {
       while (logBufferFlushing != null && !deleted) {
         switchBufferCondition.wait(100);
@@ -325,16 +323,16 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
       logBufferWorking = null;
       switchBufferCondition.notifyAll();
     }
-    long elapse = System.currentTimeMillis() - start;
-    if (elapse > 2000) {
-      logger.error("[wal] switch Working -> Flushing cost: {}ms", elapse);
-    }
+//    long elapse = System.currentTimeMillis() - start;
+//    if (elapse > 2000) {
+//      logger.error("[wal] switch Working -> Flushing cost: {}ms", elapse);
+//    }
     //    logger.warn("[wal] {} switchBufferWorkingToFlushing end", this.hashCode());
   }
 
   private void switchBufferIdleToWorking() throws InterruptedException {
     //    logger.warn("[wal] {} switchBufferIdleToWorking start", this.hashCode());
-    long start = System.currentTimeMillis();
+    // long start = System.currentTimeMillis();
     synchronized (switchBufferCondition) {
       while (logBufferIdle == null && !deleted) {
         switchBufferCondition.wait(100);
@@ -343,16 +341,16 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
       logBufferIdle = null;
       switchBufferCondition.notifyAll();
     }
-    long elapse = System.currentTimeMillis() - start;
-    if (elapse > 2000) {
-      logger.error("[wal] switch Idle -> Working cost: {}ms", elapse);
-    }
+//    long elapse = System.currentTimeMillis() - start;
+//    if (elapse > 2000) {
+//      logger.error("[wal] switch Idle -> Working cost: {}ms", elapse);
+//    }
     //    logger.warn("[wal] {} switchBufferIdleToWorking end", this.hashCode());
   }
 
   private void switchBufferFlushingToIdle() throws InterruptedException {
     //    logger.warn("[wal] {} switchBufferFlushingToIdle start", this.hashCode());
-    long start = System.currentTimeMillis();
+//    long start = System.currentTimeMillis();
     synchronized (switchBufferCondition) {
       while (logBufferIdle != null && !deleted) {
         switchBufferCondition.wait(100);
@@ -362,10 +360,10 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
       logBufferFlushing = null;
       switchBufferCondition.notifyAll();
     }
-    long elapse = System.currentTimeMillis() - start;
-    if (elapse > 2000) {
-      logger.error("[wal] switch Flushing -> Idle cost: {}ms", elapse);
-    }
+//    long elapse = System.currentTimeMillis() - start;
+//    if (elapse > 2000) {
+//      logger.error("[wal] switch Flushing -> Idle cost: {}ms", elapse);
+//    }
     //    logger.warn("[wal] {} switchBufferFlushingToIdle end", this.hashCode());
   }
 

[iotdb] 02/02: spotless

Posted by ha...@apache.org.
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

commit 01a50ab29cff8b3ad9e5107b9ec61f5b658ca416
Author: HTHou <hh...@outlook.com>
AuthorDate: Wed Jul 21 18:21:27 2021 +0800

    spotless
---
 .../db/writelog/node/ExclusiveWriteLogNode.java    | 28 +++++++++++-----------
 1 file changed, 14 insertions(+), 14 deletions(-)

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 57d8c15..0a663cd 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
@@ -314,7 +314,7 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
 
   private void switchBufferWorkingToFlushing() throws InterruptedException {
     //    logger.warn("[wal] {} switchBufferWorkingToFlushing start", this.hashCode());
-    //long start = System.currentTimeMillis();
+    // long start = System.currentTimeMillis();
     synchronized (switchBufferCondition) {
       while (logBufferFlushing != null && !deleted) {
         switchBufferCondition.wait(100);
@@ -323,10 +323,10 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
       logBufferWorking = null;
       switchBufferCondition.notifyAll();
     }
-//    long elapse = System.currentTimeMillis() - start;
-//    if (elapse > 2000) {
-//      logger.error("[wal] switch Working -> Flushing cost: {}ms", elapse);
-//    }
+    //    long elapse = System.currentTimeMillis() - start;
+    //    if (elapse > 2000) {
+    //      logger.error("[wal] switch Working -> Flushing cost: {}ms", elapse);
+    //    }
     //    logger.warn("[wal] {} switchBufferWorkingToFlushing end", this.hashCode());
   }
 
@@ -341,16 +341,16 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
       logBufferIdle = null;
       switchBufferCondition.notifyAll();
     }
-//    long elapse = System.currentTimeMillis() - start;
-//    if (elapse > 2000) {
-//      logger.error("[wal] switch Idle -> Working cost: {}ms", elapse);
-//    }
+    //    long elapse = System.currentTimeMillis() - start;
+    //    if (elapse > 2000) {
+    //      logger.error("[wal] switch Idle -> Working cost: {}ms", elapse);
+    //    }
     //    logger.warn("[wal] {} switchBufferIdleToWorking end", this.hashCode());
   }
 
   private void switchBufferFlushingToIdle() throws InterruptedException {
     //    logger.warn("[wal] {} switchBufferFlushingToIdle start", this.hashCode());
-//    long start = System.currentTimeMillis();
+    //    long start = System.currentTimeMillis();
     synchronized (switchBufferCondition) {
       while (logBufferIdle != null && !deleted) {
         switchBufferCondition.wait(100);
@@ -360,10 +360,10 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
       logBufferFlushing = null;
       switchBufferCondition.notifyAll();
     }
-//    long elapse = System.currentTimeMillis() - start;
-//    if (elapse > 2000) {
-//      logger.error("[wal] switch Flushing -> Idle cost: {}ms", elapse);
-//    }
+    //    long elapse = System.currentTimeMillis() - start;
+    //    if (elapse > 2000) {
+    //      logger.error("[wal] switch Flushing -> Idle cost: {}ms", elapse);
+    //    }
     //    logger.warn("[wal] {} switchBufferFlushingToIdle end", this.hashCode());
   }