运维工具

数据文件夹概览工具

IoTDB数据文件夹概览工具用于打印出数据文件夹的结构概览信息,工具位置为 tools/tsfile/print-iotdb-data-dir。

用法

  • Windows:
1. .\print-iotdb-data-dir.bat <IoTDB数据文件夹路径,如果是多个文件夹用逗号分隔> (<输出结果的存储路径>)
  • Linux or MacOs:
1. ./print-iotdb-data-dir.sh <IoTDB数据文件夹路径,如果是多个文件夹用逗号分隔> (<输出结果的存储路径>)

注意:如果没有设置输出结果的存储路径, 将使用相对路径”IoTDB_data_dir_overview.txt”作为默认值。

示例

以Windows系统为例:

1. .\print-iotdb-data-dir.bat D:\github\master\iotdb\data\datanode\data
2. ````````````````````````
3. Starting Printing the IoTDB Data Directory Overview
4. ````````````````````````
5. output save path:IoTDB_data_dir_overview.txt
6. data dir num:1
7. 143  [main] WARN  o.a.i.t.c.conf.TSFileDescriptor - not found iotdb-common.properties, use the default configs.
8. |==============================================================
9. |D:\github\master\iotdb\data\datanode\data
10. |--sequence
11. |  |--root.redirect0
12. |  |  |--1
13. |  |  |  |--0
14. |  |--root.redirect1
15. |  |  |--2
16. |  |  |  |--0
17. |  |--root.redirect2
18. |  |  |--3
19. |  |  |  |--0
20. |  |--root.redirect3
21. |  |  |--4
22. |  |  |  |--0
23. |  |--root.redirect4
24. |  |  |--5
25. |  |  |  |--0
26. |  |--root.redirect5
27. |  |  |--6
28. |  |  |  |--0
29. |  |--root.sg1
30. |  |  |--0
31. |  |  |  |--0
32. |  |  |  |--2760
33. |--unsequence
34. |==============================================================

TsFile概览工具

TsFile概览工具用于以概要模式打印出一个TsFile的内容,工具位置为 tools/tsfile/print-tsfile。

用法

  • Windows:
1. .\print-tsfile-sketch.bat <TsFile文件路径> (<输出结果的存储路径>)
  • Linux or MacOs:
1. ./print-tsfile-sketch.sh <TsFile文件路径> (<输出结果的存储路径>)

注意:如果没有设置输出结果的存储路径, 将使用相对路径”TsFile_sketch_view.txt”作为默认值。

示例

以Windows系统为例:

1. .\print-tsfile.bat D:\github\master\1669359533965-1-0-0.tsfile D:\github\master\sketch.txt
2. ````````````````````````
3. Starting Printing the TsFile Sketch
4. ````````````````````````
5. TsFile path:D:\github\master\1669359533965-1-0-0.tsfile
6. Sketch save path:D:\github\master\sketch.txt
7. 148  [main] WARN  o.a.i.t.c.conf.TSFileDescriptor - not found iotdb-common.properties, use the default configs.
8. -------------------------------- TsFile Sketch --------------------------------
9. file path: D:\github\master\1669359533965-1-0-0.tsfile
10. file length: 2974

12. POSITION|   CONTENT
13. --------    -------
14. 0|   [magic head] TsFile
15. 6|   [version number] 3
16. ||||||||||||||||||||| [Chunk Group] of root.sg1.d1, num of Chunks:3
17. 7|   [Chunk Group Header]
18. |           [marker] 0
19. |           [deviceID] root.sg1.d1
20. 20|   [Chunk] of root.sg1.d1.s1, startTime: 1669359533948 endTime: 1669359534047 count: 100 [minValue:-9032452783138882770,maxValue:9117677033041335123,firstValue:7068645577795875906,lastValue:-5833792328174747265,sumValue:5.795959009889246E19]
21. |           [chunk header] marker=5, measurementID=s1, dataSize=864, dataType=INT64, compressionType=SNAPPY, encodingType=RLE
22. |           [page]  UncompressedSize:862, CompressedSize:860
23. 893|   [Chunk] of root.sg1.d1.s2, startTime: 1669359533948 endTime: 1669359534047 count: 100 [minValue:-8806861312244965718,maxValue:9192550740609853234,firstValue:1150295375739457693,lastValue:-2839553973758938646,sumValue:8.2822564314572677E18]
24. |           [chunk header] marker=5, measurementID=s2, dataSize=864, dataType=INT64, compressionType=SNAPPY, encodingType=RLE
25. |           [page]  UncompressedSize:862, CompressedSize:860
26. 1766|   [Chunk] of root.sg1.d1.s3, startTime: 1669359533948 endTime: 1669359534047 count: 100 [minValue:-9076669333460323191,maxValue:9175278522960949594,firstValue:2537897870994797700,lastValue:7194625271253769397,sumValue:-2.126008424849926E19]
27. |           [chunk header] marker=5, measurementID=s3, dataSize=864, dataType=INT64, compressionType=SNAPPY, encodingType=RLE
28. |           [page]  UncompressedSize:862, CompressedSize:860
29. ||||||||||||||||||||| [Chunk Group] of root.sg1.d1 ends
30. 2656|   [marker] 2
31. 2657|   [TimeseriesIndex] of root.sg1.d1.s1, tsDataType:INT64, startTime: 1669359533948 endTime: 1669359534047 count: 100 [minValue:-9032452783138882770,maxValue:9117677033041335123,firstValue:7068645577795875906,lastValue:-5833792328174747265,sumValue:5.795959009889246E19]
32. |           [ChunkIndex] offset=20
33. 2728|   [TimeseriesIndex] of root.sg1.d1.s2, tsDataType:INT64, startTime: 1669359533948 endTime: 1669359534047 count: 100 [minValue:-8806861312244965718,maxValue:9192550740609853234,firstValue:1150295375739457693,lastValue:-2839553973758938646,sumValue:8.2822564314572677E18]
34. |           [ChunkIndex] offset=893
35. 2799|   [TimeseriesIndex] of root.sg1.d1.s3, tsDataType:INT64, startTime: 1669359533948 endTime: 1669359534047 count: 100 [minValue:-9076669333460323191,maxValue:9175278522960949594,firstValue:2537897870994797700,lastValue:7194625271253769397,sumValue:-2.126008424849926E19]
36. |           [ChunkIndex] offset=1766
37. 2870|   [IndexOfTimerseriesIndex Node] type=LEAF_MEASUREMENT
38. |           <s1, 2657>
39. |           <endOffset, 2870>
40. ||||||||||||||||||||| [TsFileMetadata] begins
41. 2891|   [IndexOfTimerseriesIndex Node] type=LEAF_DEVICE
42. |           <root.sg1.d1, 2870>
43. |           <endOffset, 2891>
44. |   [meta offset] 2656
45. |   [bloom filter] bit vector byte array length=31, filterSize=256, hashFunctionSize=5
46. ||||||||||||||||||||| [TsFileMetadata] ends
47. 2964|   [TsFileMetadataSize] 73
48. 2968|   [magic tail] TsFile
49. 2974|   END of TsFile
50. ---------------------------- IndexOfTimerseriesIndex Tree -----------------------------
51. [MetadataIndex:LEAF_DEVICE]
52. └──────[root.sg1.d1,2870]
53. [MetadataIndex:LEAF_MEASUREMENT]
54. └──────[s1,2657]
55. ---------------------------------- TsFile Sketch End ----------------------------------

解释:

  • 以”|”为分隔,左边是在TsFile文件中的实际位置,右边是梗概内容。
  • “|||||||||||||||||||||”是为增强可读性而添加的导引信息,不是TsFile中实际存储的数据。
  • 最后打印的”IndexOfTimerseriesIndex Tree”是对TsFile文件末尾的元数据索引树的重新整理打印,便于直观理解,不是TsFile中存储的实际数据。

TsFile Resource概览工具

TsFile resource概览工具用于打印出TsFile resource文件的内容,工具位置为 tools/tsfile/print-tsfile-resource-files。

用法

  • Windows:
1. .\print-tsfile-resource-files.bat <TsFile resource文件所在的文件夹路径,或者单个TsFile resource文件路径>
  • Linux or MacOs:
1. ./print-tsfile-resource-files.sh <TsFile resource文件所在的文件夹路径,或者单个TsFile resource文件路径>

示例

以Windows系统为例:

1. .\print-tsfile-resource-files.bat D:\github\master\iotdb\data\datanode\data\sequence\root.sg1\0\0
2. ````````````````````````
3. Starting Printing the TsFileResources
4. ````````````````````````
5. 147  [main] WARN  o.a.i.t.c.conf.TSFileDescriptor - not found iotdb-common.properties, use the default configs.
6. 230  [main] WARN  o.a.iotdb.db.conf.IoTDBDescriptor - Cannot find IOTDB_HOME or IOTDB_CONF environment variable when loading config file iotdb-common.properties, use default configuration
7. 231  [main] WARN  o.a.iotdb.db.conf.IoTDBDescriptor - Couldn't load the configuration iotdb-common.properties from any of the known sources.
8. 233  [main] WARN  o.a.iotdb.db.conf.IoTDBDescriptor - Cannot find IOTDB_HOME or IOTDB_CONF environment variable when loading config file iotdb-datanode.properties, use default configuration
9. 237  [main] WARN  o.a.iotdb.db.conf.IoTDBDescriptor - Couldn't load the configuration iotdb-datanode.properties from any of the known sources.
10. Analyzing D:\github\master\iotdb\data\datanode\data\sequence\root.sg1\0\0\1669359533489-1-0-0.tsfile ...

12. Resource plan index range [9223372036854775807, -9223372036854775808]
13. device root.sg1.d1, start time 0 (1970-01-01T08:00+08:00[GMT+08:00]), end time 99 (1970-01-01T08:00:00.099+08:00[GMT+08:00])

15. Analyzing the resource file folder D:\github\master\iotdb\data\datanode\data\sequence\root.sg1\0\0 finished.
1. .\print-tsfile-resource-files.bat D:\github\master\iotdb\data\datanode\data\sequence\root.sg1\0\0\1669359533489-1-0-0.tsfile.resource
2. ````````````````````````
3. Starting Printing the TsFileResources
4. ````````````````````````
5. 178  [main] WARN  o.a.iotdb.db.conf.IoTDBDescriptor - Cannot find IOTDB_HOME or IOTDB_CONF environment variable when loading config file iotdb-common.properties, use default configuration
6. 186  [main] WARN  o.a.i.t.c.conf.TSFileDescriptor - not found iotdb-common.properties, use the default configs.
7. 187  [main] WARN  o.a.iotdb.db.conf.IoTDBDescriptor - Couldn't load the configuration iotdb-common.properties from any of the known sources.
8. 188  [main] WARN  o.a.iotdb.db.conf.IoTDBDescriptor - Cannot find IOTDB_HOME or IOTDB_CONF environment variable when loading config file iotdb-datanode.properties, use default configuration
9. 192  [main] WARN  o.a.iotdb.db.conf.IoTDBDescriptor - Couldn't load the configuration iotdb-datanode.properties from any of the known sources.
10. Analyzing D:\github\master\iotdb\data\datanode\data\sequence\root.sg1\0\0\1669359533489-1-0-0.tsfile ...

12. Resource plan index range [9223372036854775807, -9223372036854775808]
13. device root.sg1.d1, start time 0 (1970-01-01T08:00+08:00[GMT+08:00]), end time 99 (1970-01-01T08:00:00.099+08:00[GMT+08:00])

15. Analyzing the resource file D:\github\master\iotdb\data\datanode\data\sequence\root.sg1\0\0\1669359533489-1-0-0.tsfile.resource finished.