You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2019/06/07 18:52:17 UTC

[incubator-iotdb] branch feature_async_close_tsfile updated: change overflow resourse memtable flush to flushTask

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

hxd 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 b12ad1c  change overflow resourse memtable flush to flushTask
b12ad1c is described below

commit b12ad1c37a6daf5a0ccaa8560389d984832e71ce
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Sat Jun 8 02:52:01 2019 +0800

    change overflow resourse memtable flush to flushTask
---
 .../apache/iotdb/db/engine/overflow/io/OverflowResource.java  | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowResource.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowResource.java
index 17078f8..e7167fb 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowResource.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowResource.java
@@ -32,6 +32,7 @@ import java.util.Map;
 import org.apache.commons.io.FileUtils;
 import org.apache.iotdb.db.conf.IoTDBConstant;
 import org.apache.iotdb.db.engine.memtable.IMemTable;
+import org.apache.iotdb.db.engine.memtable.MemTableFlushTask;
 import org.apache.iotdb.db.engine.memtable.MemTableFlushUtil;
 import org.apache.iotdb.db.engine.modification.Deletion;
 import org.apache.iotdb.db.engine.modification.Modification;
@@ -210,7 +211,7 @@ public class OverflowResource {
     // insert data
     long startPos = insertIO.getPos();
     long startTime = System.currentTimeMillis();
-    flush(fileSchema, memTable);
+    flush2(fileSchema, memTable, processorName);
     long timeInterval = System.currentTimeMillis() - startTime;
     timeInterval = timeInterval == 0 ? 1 : timeInterval;
     long insertSize = insertIO.getPos() - startPos;
@@ -225,12 +226,14 @@ public class OverflowResource {
     writePositionInfo(insertIO.getPos(), 0);
   }
 
-  public void flush(FileSchema fileSchema, IMemTable memTable) throws IOException {
+  public void flush2(FileSchema fileSchema, IMemTable memTable, String processorName) throws IOException {
     if (memTable != null && !memTable.isEmpty()) {
       insertIO.toTail();
       long lastPosition = insertIO.getPos();
-      MemTableFlushUtil.flushMemTable(fileSchema, insertIO, memTable,
-          versionController.nextVersion());
+//      MemTableFlushUtil.flushMemTable(fileSchema, insertIO, memTable,
+//          versionController.nextVersion());
+      MemTableFlushTask task = new MemTableFlushTask(insertIO, processorName);
+      task.flushMemTable(fileSchema, memTable, versionController.nextVersion());
       List<ChunkGroupMetaData> rowGroupMetaDatas = insertIO.getChunkGroupMetaDatas();
       appendInsertMetadatas.addAll(rowGroupMetaDatas);
       if (!rowGroupMetaDatas.isEmpty()) {