From 9e1c46f6234fb993b9e9719da81c9ec5779e7a19 Mon Sep 17 00:00:00 2001 From: HTHou Date: Thu, 8 Jan 2026 12:15:14 +0800 Subject: [PATCH] No need to init TierManager when using TsFileResourcePrinter --- .../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 7fe4ca1d01e4..530181fd1f32 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 static void main(String[] args) throws IOException { 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 static void main(String[] args) throws IOException { @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();