@@ -255,11 +254,29 @@ A TsFile ends with a 6-byte magic string (`TsFile`).
Congratulations! You have finished the journey of discovering TsFile.
### 1.3 TsFile Tool Set
## 2. A TsFile Visualization Example
#### 1.3.1 IoTDB Data Directory Overview Tool
### v0.8
After building the server, the startup script of this tool will appear under the `server\target\iotdb-server-0.13.0-SNAPSHOT\tools\tsfileToolSet` directory.
Starting Printing the IoTDB Data Directory Overview
|````````````````````````
|````````````````````````
output save path:IoTDB_data_dir_overview.txt
TsFile data dir num:1
21:17:38.841 [main] WARN org.apache.iotdb.tsfile.common.conf.TSFileDescriptor - Failed to find config file iotdb-engine.properties at classpath, use default configuration
...
...
@@ -308,9 +325,9 @@ TsFile data dir num:1
#### 1.3.2 TsFileResource Print Tool
###3.2 TsFileResource Print Tool
After building the server, the startup script of this tool will appear under the `server\target\iotdb-server-0.13.0-SNAPSHOT\tools\tsfileToolSet` directory.
After building the server, the startup script of this tool will appear under the `server\target\iotdb-server-{version}\tools\tsfileToolSet` directory.
device root.vehicle.d0, start time 3000 (1970-01-01T08:00:03+08:00[GMT+08:00]), end time 100999 (1970-01-01T08:01:40.999+08:00[GMT+08:00])
analyzing the resource file finished.
```
#### 1.3.3 TsFile Sketch Tool
###3.3 TsFile Sketch Tool
After building the server, the startup script of this tool will appear under the `server\target\iotdb-server-0.13.0-SNAPSHOT\tools\tsfileToolSet` directory.
After building the server, the startup script of this tool will appear under the `server\target\iotdb-server-{version}\tools\tsfileToolSet` directory.
Vis is a tool that visualizes the time layouts and cout aggregation of chunk data in TsFiles. You can use this tool to facilitate debugging, check the distribution of data, etc. Please feel free to play around with it, and let us know your thoughts.
The source code contains two files: `TsFileExtractVisdata.java` and `vis.m`. `TsFileExtractVisdata.java` extracts, from input tsfiles, necessary visualization information, which is what `vis.m` needs to plot figures.
Simply put, you first run `TsFileExtractVisdata.java` and then run `vis.m`.
##### Step 1: run TsFileExtractVisdata.java
`TsFileExtractVisdata.java` extracts visdata [tsName, fileName, chunkId, startTime, endTime, pointCountNum] from every chunk of the input TsFiles and write them to the specified output path.
After building the server, the startup script of this tool will appear under the `server\target\iotdb-server-{version}\tools\tsfileToolSet` directory.
-`seqIndicator` should be 'true' or 'false' (not case sensitive). 'true' means is the file is sequence, 'false' means the file is unsequence.
-`Path` can be the full path of a tsfile or a directory path. If it is a directory path, make sure that all tsfiles in this directory have the same `seqIndicator`.
- The input TsFiles should all be sealed. The handle of unsealed TsFile is left as future work when in need.
##### Step 2: run vis.m
`vis.m` load visdata generated by `TsFileExtractVisdata`, and then plot figures given the loaded visdata and two plot parameters: `showSpecific` and `isFileOrder`.
% Plot figures given the loaded data and two plot parameters:
% `showSpecific` and `isFileOrder`.
%
% process: 1) traverse `keys(timeMap)` to get the position arrangements on
% the y axis dynamically, which is defined simultaneously by
% (a)`showSpecific`: traverse `keys(timeMap)`, filter out keys
% that don't statisfy `showSpecific`.
% (b) seqKey/unseqKey display policies: extract seqKey or unseqKey
% from statisfied keys under different display policies:
% b-1) unseqKey identifies tsName and fileName, so chunk data with the
% same fileName and tsName but different chunkIds are
% plotted on the same line.
% b-2) seqKey identifies tsName, so chunk data with the same tsName but
% different fileNames and chunkIds are plotted on the same
% line.
% (c)`isFileOrder`: sort seqKey&unseqKey according to `isFileOrder`,
% finally get the position arrangements on the y axis.
% 2) traverse `keys(timeMap)` again, get startTime&endTime from
% `treeMap` as positions on the x axis, combined with the
% positions on the y axis from the last step, finish plot.
%
% timeMap,countMap: generated by loadVisData function.
%
% showSpecific: the specific set of time series to be plotted.
% If showSpecific is empty{}, then all loaded time series
% will be plotted.
% Note: Wildcard matching is not supported now. In other
% words, showSpecific only support full time series path
% names.
%
% isFileOrder: true to sort seqKeys&unseqKeys by fileName priority, false
% to sort seqKeys&unseqKeys by tsName priority.
```
#### 3.5.2 Examples
##### Example 1
Use the tsfiles written by `IoTDBLargeDataIT.insertData` with a little modification: add `statement.execute("flush");` at the end of `IoTDBLargeDataIT.insertData`.