You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ji...@apache.org on 2019/06/14 01:36:13 UTC

[incubator-iotdb] branch feature_async_close_tsfile updated: remove sync thread in wal

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

jiangtian pushed a commit to branch feature_async_close_tsfile
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/feature_async_close_tsfile by this push:
     new 1d2bfb4  remove sync thread in wal
     new b8ff779  Merge branch 'feature_async_close_tsfile' of github.com:apache/incubator-iotdb into feature_async_close_tsfile
1d2bfb4 is described below

commit 1d2bfb48651dcf6eb7e3879493c970f43cee6f1b
Author: 江天 <jt...@163.com>
AuthorDate: Fri Jun 14 09:33:44 2019 +0800

    remove sync thread in wal
---
 .../db/writelog/manager/MultiFileLogNodeManager.java      | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/iotdb/src/main/java/org/apache/iotdb/db/writelog/manager/MultiFileLogNodeManager.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/manager/MultiFileLogNodeManager.java
index 8b20df2..7832a7a 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/writelog/manager/MultiFileLogNodeManager.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/manager/MultiFileLogNodeManager.java
@@ -42,7 +42,6 @@ public class MultiFileLogNodeManager implements WriteLogNodeManager, IService {
   private static final Logger logger = LoggerFactory.getLogger(MultiFileLogNodeManager.class);
   private Map<String, WriteLogNode> nodeMap;
 
-  private Thread syncThread;
   private Thread forceThread;
   private IoTDBConfig config = IoTDBDescriptor.getInstance().getConfig();
 
@@ -117,18 +116,11 @@ public class MultiFileLogNodeManager implements WriteLogNodeManager, IService {
 
   @Override
   public void close() {
-    if (!isActivated(syncThread) && !isActivated(forceThread)) {
+    if (!isActivated(forceThread)) {
       logger.error("MultiFileLogNodeManager has not yet started");
       return;
     }
     logger.info("LogNodeManager starts closing..");
-    if (isActivated(syncThread)) {
-      syncThread.interrupt();
-      logger.info("Waiting for sync thread to stop");
-      while (syncThread.isAlive()) {
-        // wait for syncThread
-      }
-    }
     if (isActivated(forceThread)) {
       forceThread.interrupt();
       logger.info("Waiting for force thread to stop");
@@ -181,9 +173,8 @@ public class MultiFileLogNodeManager implements WriteLogNodeManager, IService {
       if (!config.isEnableWal()) {
         return;
       }
-      if (!isActivated(syncThread)) {
-        InstanceHolder.instance.syncThread.start();
-        if (config.getForceWalPeriodInMs() > 0 && !isActivated(forceThread)) {
+      if (!isActivated(forceThread)) {
+        if (config.getForceWalPeriodInMs() > 0) {
           InstanceHolder.instance.forceThread = new Thread(InstanceHolder.instance.forceTask,
               ThreadName.WAL_FORCE_DAEMON.getName());
           InstanceHolder.instance.forceThread.start();