You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2022/05/26 02:42:46 UTC

[iotdb] 02/02: add rename function

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

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

commit 2bc26b539e2829b948ea1990f12b4d30e84e6c82
Author: Alima777 <wx...@gmail.com>
AuthorDate: Wed May 25 19:57:04 2022 +0800

    add rename function
---
 rewriteBadFile/src/main/java/org/apache/iotdb/RewriteBadFileTool.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/rewriteBadFile/src/main/java/org/apache/iotdb/RewriteBadFileTool.java b/rewriteBadFile/src/main/java/org/apache/iotdb/RewriteBadFileTool.java
index 9a75e529c6..a33ccbfafd 100644
--- a/rewriteBadFile/src/main/java/org/apache/iotdb/RewriteBadFileTool.java
+++ b/rewriteBadFile/src/main/java/org/apache/iotdb/RewriteBadFileTool.java
@@ -144,8 +144,10 @@ public class RewriteBadFileTool {
       String targetFilePath =
           backUpDirPath + File.separator + "sequence" + badFilePath.split("sequence")[1];
       try {
-        if (new File(targetFilePath).exists()) {
+        File targetFile = new File(targetFilePath);
+        if (targetFile.exists()) {
           rewriteWrongTsFile(targetFilePath, session);
+          targetFile.renameTo(new File(targetFilePath + "." + "finish"));
         } else {
           printBoth("---- Meet error in rewriting, " + targetFilePath + " does not exist.");
         }