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 2020/06/29 01:21:05 UTC

[GitHub] [incubator-iotdb] SilverNarcissus commented on a change in pull request #1423: [IOTDB-782] [Experimental] Clear mlog when creating snapshot

SilverNarcissus commented on a change in pull request #1423:
URL: https://github.com/apache/incubator-iotdb/pull/1423#discussion_r446726108



##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/MLogWriter.java
##########
@@ -160,6 +162,14 @@ public static void upgradeMLog(String schemaDir, String logFileName) throws IOEx
     FSFactoryProducer.getFSFactory().moveFile(tmpLogFile, logFile);
   }
 
+  public void clear() throws IOException {
+    writer.close();
+    Files.delete(logFile.toPath());
+    FileWriter fileWriter = new FileWriter(logFile, true);

Review comment:
       Maybe you should use file.getChannel().truncate(0) to clear mlog




----------------------------------------------------------------
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