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

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

commit 9e1c46f6234fb993b9e9719da81c9ec5779e7a19
Author: HTHou <[email protected]>
AuthorDate: Thu Jan 8 12:15:14 2026 +0800

    No need to init TierManager when using TsFileResourcePrinter
---
 .../main/java/org/apache/iotdb/db/tools/TsFileResourcePrinter.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/tools/TsFileResourcePrinter.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/tools/TsFileResourcePrinter.java
index 7fe4ca1d01e..530181fd1f3 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/tools/TsFileResourcePrinter.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/tools/TsFileResourcePrinter.java
@@ -50,7 +50,7 @@ public class TsFileResourcePrinter {
       File[] files =
           FSFactoryProducer.getFSFactory()
               .listFilesBySuffix(folderFile.getAbsolutePath(), 
".tsfile.resource");
-      Arrays.sort(files, Comparator.comparingLong(x -> 
Long.valueOf(x.getName().split("-")[0])));
+      Arrays.sort(files, Comparator.comparingLong(x -> 
Long.parseLong(x.getName().split("-")[0])));
 
       for (File file : files) {
         printResource(file.getAbsolutePath());
@@ -66,7 +66,8 @@ public class TsFileResourcePrinter {
   @SuppressWarnings("squid:S106")
   public static void printResource(String filename) throws IOException {
     filename = filename.substring(0, filename.length() - 9);
-    TsFileResource resource = new 
TsFileResource(SystemFileFactory.INSTANCE.getFile(filename));
+    TsFileResource resource = new TsFileResource();
+    resource.setFile(SystemFileFactory.INSTANCE.getFile(filename));
     System.out.printf("Analyzing %s ...%n", filename);
     System.out.println();
     resource.deserialize();

Reply via email to