You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2019/11/11 06:25:20 UTC

[GitHub] [incubator-iotdb] HTHou commented on a change in pull request #530: [IOTDB-295] Refactor db.exception

HTHou commented on a change in pull request #530: [IOTDB-295] Refactor db.exception
URL: https://github.com/apache/incubator-iotdb/pull/530#discussion_r344568567
 
 

 ##########
 File path: server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
 ##########
 @@ -102,27 +102,25 @@ private StorageEngine() {
     try {
       FileUtils.forceMkdir(SystemFileFactory.INSTANCE.getFile(systemDir));
     } catch (IOException e) {
-      throw new StorageEngineFailureException("create system directory failed!");
+      throw new StorageEngineFailureException(e);
     }
 
     /*
      * recover all storage group processors.
      */
-    List<MNode> sgNodes = MManager.getInstance().getAllStorageGroups();
-    List<Future> futures = new ArrayList<>();
-    for (MNode storageGroup : sgNodes) {
-      futures.add(recoveryThreadPool.submit((Callable<Void>) () -> {
-          StorageGroupProcessor processor = new StorageGroupProcessor(systemDir,storageGroup.getFullPath());
-          processor.setDataTTL(storageGroup.getDataTTL());
-          processorMap.put(storageGroup.getFullPath(), processor);
-          logger.info("Storage Group Processor {} is recovered successfully",storageGroup.getFullPath());
+
+      List<MNode> sgNodes = MManager.getInstance().getAllStorageGroups();
+    List<Future> futures = new ArrayList<>();  for (MNode storageGroup : sgNodes) {
+      futures.add(recoveryThreadPool.submit((Callable<Void>) () -> {  StorageGroupProcessor processor = new StorageGroupProcessor(systemDir, storageGroup.getFullPath());
+        processor.setDataTTL(storageGroup.getDataTTL());
+        processorMap.put(storageGroup.getFullPath(), processor);logger.info("Storage Group Processor {} is recovered successfully", storageGroup.getFullPath());
         return null;
 
 Review comment:
   It also will be better if you separate these lines to some shorter lines.
   There is a format issue at line 113. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services