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

[incubator-iotdb] branch feature_async_close_tsfile updated: add storage group name

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

lta 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 ace45e5  add storage group name
     new 56957e1  Merge branch 'feature_async_close_tsfile' of github.com:apache/incubator-iotdb into feature_async_close_tsfile
ace45e5 is described below

commit ace45e51178aca050f0d39e4f09e2c586fa87ae7
Author: lta <li...@163.com>
AuthorDate: Sat Jun 22 15:09:34 2019 +0800

    add storage group name
---
 .../apache/iotdb/db/engine/filenodeV2/FileNodeProcessorV2.java   | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenodeV2/FileNodeProcessorV2.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenodeV2/FileNodeProcessorV2.java
index 73dcc08..9632398 100755
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenodeV2/FileNodeProcessorV2.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenodeV2/FileNodeProcessorV2.java
@@ -195,9 +195,12 @@ public class FileNodeProcessorV2 {
       // create a new BufferWriteProcessor
       if (sequence) {
         if (workSequenceTsFileProcessor == null) {
+
+          // TODO directories add method getAndCreateNextFolderTsfile
           String baseDir = directories.getNextFolderForTsfile();
-          String filePath = Paths.get(baseDir, System.currentTimeMillis() + "-" + versionController.nextVersion()).toString();
+          String filePath = Paths.get(baseDir, storageGroupName, System.currentTimeMillis() + "-" + versionController.nextVersion()).toString();
 
+          new File(baseDir, storageGroupName).mkdirs();
           workSequenceTsFileProcessor = new UnsealedTsFileProcessorV2(storageGroupName, new File(filePath),
               fileSchema, versionController, this::closeUnsealedTsFileProcessorCallback, this::updateLatestFlushTimeCallback);
 
@@ -208,8 +211,8 @@ public class FileNodeProcessorV2 {
         if (workUnSequenceTsFileProcessor == null) {
           // TODO check if the disk is full
           String baseDir = IoTDBDescriptor.getInstance().getConfig().getOverflowDataDir();
-          new File(baseDir).mkdirs();
-          String filePath = Paths.get(baseDir, System.currentTimeMillis() + "-" + +versionController.nextVersion()).toString();
+          new File(baseDir, storageGroupName).mkdirs();
+          String filePath = Paths.get(baseDir, storageGroupName, System.currentTimeMillis() + "-" + +versionController.nextVersion()).toString();
 
           workUnSequenceTsFileProcessor = new UnsealedTsFileProcessorV2(storageGroupName, new File(filePath),
               fileSchema, versionController, this::closeUnsealedTsFileProcessorCallback, this::updateLatestFlushTimeCallback);