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 2022/04/14 11:46:38 UTC

[iotdb] branch dataregionIdBug created (now 2a860bdb5c)

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

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


      at 2a860bdb5c fix dataregionId directory name bug

This branch includes the following new commits:

     new 2a860bdb5c fix dataregionId directory name bug

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.



[iotdb] 01/01: fix dataregionId directory name bug

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

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

commit 2a860bdb5cd3f8918fd8bc947613b8522573e86a
Author: HTHou <hh...@outlook.com>
AuthorDate: Thu Apr 14 19:46:22 2022 +0800

    fix dataregionId directory name bug
---
 .../org/apache/iotdb/db/engine/StorageEngineV2.java     | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/engine/StorageEngineV2.java b/server/src/main/java/org/apache/iotdb/db/engine/StorageEngineV2.java
index c45df9f494..3c8e9a77b8 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/StorageEngineV2.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/StorageEngineV2.java
@@ -252,7 +252,7 @@ public class StorageEngineV2 implements IService {
           continue;
         }
         ConsensusGroupId dataRegionId = new DataRegionId(Integer.parseInt(dataRegionDir.getName()));
-        DataRegion dataRegion = buildNewStorageGroupProcessor(sg, dataRegionDir.getName(), ttl);
+        DataRegion dataRegion = buildNewDataRegion(sg, dataRegionDir.getName(), ttl);
         dataRegionMap.putIfAbsent(dataRegionId, dataRegion);
       }
     }
@@ -430,23 +430,22 @@ public class StorageEngineV2 implements IService {
   }
 
   /**
-   * build a new storage group processor
+   * build a new data region
    *
-   * @param virtualStorageGroupId virtual storage group id e.g. 1
+   * @param dataRegionId virtual storage group id e.g. 1
    * @param logicalStorageGroupName logical storage group name e.g. root.sg1
    */
-  public DataRegion buildNewStorageGroupProcessor(
-      String logicalStorageGroupName, String virtualStorageGroupId, long ttl)
-      throws DataRegionException {
+  public DataRegion buildNewDataRegion(
+      String logicalStorageGroupName, String dataRegionId, long ttl) throws DataRegionException {
     DataRegion processor;
     logger.info(
-        "construct a processor instance, the storage group is {}, Thread is {}",
+        "construct a data region instance, the storage group is {}, Thread is {}",
         logicalStorageGroupName,
         Thread.currentThread().getId());
     processor =
         new DataRegion(
             systemDir + File.separator + logicalStorageGroupName,
-            virtualStorageGroupId,
+            dataRegionId,
             fileFlushPolicy,
             logicalStorageGroupName);
     processor.setDataTTL(ttl);
@@ -555,7 +554,7 @@ public class StorageEngineV2 implements IService {
   // the local engine before adding the corresponding consensusGroup to the consensus layer
   public DataRegion createDataRegion(DataRegionId regionId, String sg, long ttl)
       throws DataRegionException {
-    DataRegion dataRegion = buildNewStorageGroupProcessor(sg, regionId.toString(), ttl);
+    DataRegion dataRegion = buildNewDataRegion(sg, String.valueOf(regionId.getId()), ttl);
     dataRegionMap.put(regionId, dataRegion);
     return dataRegion;
   }