You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2019/10/23 08:05:49 UTC

[incubator-iotdb] branch fix_check_type created (now 6d00d5c)

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

qiaojialin pushed a change to branch fix_check_type
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.


      at 6d00d5c  write WAL after insert memtable

This branch includes the following new commits:

     new 6d00d5c  write WAL after insert memtable

The 1 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.



[incubator-iotdb] 01/01: write WAL after insert memtable

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

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

commit 6d00d5c731020ad8792f2ca3feeb6999c69e8cc3
Author: qiaojialin <64...@qq.com>
AuthorDate: Wed Oct 23 16:05:15 2019 +0800

    write WAL after insert memtable
---
 .../iotdb/db/engine/storagegroup/TsFileProcessor.java       | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 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 902f14f..17aec9d 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
@@ -141,6 +141,9 @@ public class TsFileProcessor {
       workMemTable = MemTablePool.getInstance().getAvailableMemTable(this);
     }
 
+    // insert insertPlan to the work memtable
+    workMemTable.insert(insertPlan);
+
     if (IoTDBDescriptor.getInstance().getConfig().isEnableWal()) {
       try {
         getLogNode().write(insertPlan);
@@ -149,6 +152,7 @@ public class TsFileProcessor {
         return false;
       }
     }
+
     // update start time of this memtable
     tsFileResource.updateStartTime(insertPlan.getDeviceId(), insertPlan.getTime());
     //for sequence tsfile, we update the endTime only when the file is prepared to be closed.
@@ -157,18 +161,19 @@ public class TsFileProcessor {
       tsFileResource.updateEndTime(insertPlan.getDeviceId(), insertPlan.getTime());
     }
 
-    // insert insertPlan to the work memtable
-    workMemTable.insert(insertPlan);
-
     return true;
   }
 
   public boolean insertBatch(BatchInsertPlan batchInsertPlan, List<Integer> indexes,
       Integer[] results) throws QueryProcessorException {
+
     if (workMemTable == null) {
       workMemTable = MemTablePool.getInstance().getAvailableMemTable(this);
     }
 
+    // insert insertPlan to the work memtable
+    workMemTable.insertBatch(batchInsertPlan, indexes);
+
     if (IoTDBDescriptor.getInstance().getConfig().isEnableWal()) {
       try {
         batchInsertPlan.setIndex(new HashSet<>(indexes));
@@ -190,8 +195,6 @@ public class TsFileProcessor {
       tsFileResource.updateEndTime(batchInsertPlan.getDeviceId(), batchInsertPlan.getMaxTime());
     }
 
-    // insert insertPlan to the work memtable
-    workMemTable.insertBatch(batchInsertPlan, indexes);
     return true;
   }