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/20 09:05:04 UTC
(iotdb) branch ty/quietPrint created (now 87c27894438)
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a change to branch ty/quietPrint
in repository https://gitbox.apache.org/repos/asf/iotdb.git
at 87c27894438 Don't print warn log for sort tmp file delete
This branch includes the following new commits:
new 87c27894438 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
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 87c2789443819a2fe68951b6b32f6db1a3697519
Author: JackieTien97 <ja...@gmail.com>
AuthorDate: Fri Sep 20 17:04:51 2024 +0800
Don't print warn log for sort tmp file delete
---
.../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) {