jt2594838 commented on a change in pull request #258: [IOTDB-143]Development of 
merge
URL: https://github.com/apache/incubator-iotdb/pull/258#discussion_r314574804
 
 

 ##########
 File path: 
server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
 ##########
 @@ -185,53 +204,95 @@ public StorageGroupProcessor(String systemInfoDir, 
String storageGroupName)
   private void recover() throws ProcessorException {
     logger.info("recover Storage Group  {}", storageGroupName);
 
-    // collect TsFiles from sequential data directory
-    List<File> tsFiles = 
getAllFiles(DirectoryManager.getInstance().getAllSequenceFileFolders());
-    recoverSeqFiles(tsFiles);
-
-    // collect TsFiles from unsequential data directory
-    tsFiles = 
getAllFiles(DirectoryManager.getInstance().getAllUnSequenceFileFolders());
-    recoverUnseqFiles(tsFiles);
+    try {
+      // collect TsFiles from sequential and unsequential data directory
+      List<TsFileResource> seqTsFiles = 
getAllFiles(DirectoryManager.getInstance().getAllSequenceFileFolders());
+      List<TsFileResource> unseqTsFiles =
+          
getAllFiles(DirectoryManager.getInstance().getAllUnSequenceFileFolders());
+
+      recoverSeqFiles(seqTsFiles);
+      recoverUnseqFiles(unseqTsFiles);
+
+      String taskName = storageGroupName + "-" + System.currentTimeMillis();
+      File mergingMods = new File(storageGroupSysDir, 
MERGING_MODIFICAITON_FILE_NAME);
+      if (mergingMods.exists()) {
+        mergingModification = new ModificationFile(storageGroupSysDir + 
File.separator + MERGING_MODIFICAITON_FILE_NAME);
+      }
+      RecoverMergeTask recoverMergeTask = new RecoverMergeTask(seqTsFiles, 
unseqTsFiles,
 
 Review comment:
   This process contains the repairs of merged files, it must be done before 
the database is online. You can perform the repair parts only by setting the 
config continue_merge_after_reboot to false, but it cannot be asynchronized.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to