You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2024/09/21 02:44:59 UTC
(iotdb) branch ty/quietPrint-133 created (now bdc73192703)
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a change to branch ty/quietPrint-133
in repository https://gitbox.apache.org/repos/asf/iotdb.git
at bdc73192703 Don't print warn log for sort tmp file delete
This branch includes the following new commits:
new bdc73192703 Don't print warn log for sort tmp file delete
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: Don't print warn log for sort tmp file delete
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch ty/quietPrint-133
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit bdc73192703de245adaecef2dfae10d1eda3e922
Author: Jackie Tien <ja...@gmail.com>
AuthorDate: Sat Sep 21 10:39:13 2024 +0800
Don't print warn log for sort tmp file delete
(cherry picked from commit 0ea84cadb15f64273151c71994a9c1b2c44ffa13)
---
.../main/java/org/apache/iotdb/commons/utils/FileUtils.java | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java
index 1fca92394af..420dfda6c1f 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java
@@ -65,16 +65,19 @@ public class FileUtils {
deleteFileOrDirectory(file, false);
}
- public static void deleteFileOrDirectory(File file, boolean quiteForNoSuchFile) {
+ public static void deleteFileOrDirectory(File file, boolean quietForNoSuchFile) {
if (file.isDirectory()) {
- for (File subfile : file.listFiles()) {
- deleteFileOrDirectory(subfile);
+ File[] files = file.listFiles();
+ if (files != null) {
+ for (File subfile : files) {
+ deleteFileOrDirectory(subfile, quietForNoSuchFile);
+ }
}
}
try {
Files.delete(file.toPath());
} catch (NoSuchFileException e) {
- if (!quiteForNoSuchFile) {
+ if (!quietForNoSuchFile) {
LOGGER.warn("{}: {}", e.getMessage(), Arrays.toString(file.list()), e);
}
} catch (DirectoryNotEmptyException e) {