This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new aa0ef89 [IOTDB-685]Fix tsfile tool (#1226)
aa0ef89 is described below
commit aa0ef896b6faff9e7c38fb094516653f9488d8f8
Author: gwmh <[email protected]>
AuthorDate: Tue May 19 20:32:16 2020 +0800
[IOTDB-685]Fix tsfile tool (#1226)
* fix tsfile tool
---
.../apache/iotdb/db/tools/IoTDBDataDirViewer.java | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git
a/server/src/main/java/org/apache/iotdb/db/tools/IoTDBDataDirViewer.java
b/server/src/main/java/org/apache/iotdb/db/tools/IoTDBDataDirViewer.java
index 262de5f..68c2857 100644
--- a/server/src/main/java/org/apache/iotdb/db/tools/IoTDBDataDirViewer.java
+++ b/server/src/main/java/org/apache/iotdb/db/tools/IoTDBDataDirViewer.java
@@ -100,13 +100,29 @@ public class IoTDBDataDirViewer {
File[] files = storageGroup.listFiles();
if (files == null) {
throw new IOException(
- "Irregular data dir structure.There should be tsfiles under "
+ "Irregular data dir structure.There should be timeInterval
directories under "
+ "the storage group directory " + storageGroup.getName());
}
List<File> fileList = Arrays.asList(files);
fileList.sort(((o1, o2) -> o1.getName().compareTo(o2.getName())));
for (File file : files) {
printlnBoth(pw, "| | |--" + file.getName());
+ printFilesInTimeInterval(file, pw);
+ }
+ }
+
+ private static void printFilesInTimeInterval(File timeInterval, PrintWriter
pw)
+ throws IOException {
+ File[] files = timeInterval.listFiles();
+ if (files == null) {
+ throw new IOException(
+ "Irregular data dir structure.There should be tsfiles under "
+ + "the timeInterval directories directory " +
timeInterval.getName());
+ }
+ List<File> fileList = Arrays.asList(files);
+ fileList.sort(((o1, o2) -> o1.getName().compareTo(o2.getName())));
+ for (File file : files) {
+ printlnBoth(pw, "| | | |--" + file.getName());
// To print the content if it is a tsfile.resource
if (file.getName().endsWith(".tsfile.resource")) {
@@ -123,7 +139,7 @@ public class IoTDBDataDirViewer {
SortedSet<String> keys = new
TreeSet<>(resource.getStartTimeMap().keySet());
for (String device : keys) {
printlnBoth(pw,
- String.format("| | | |--device %s, start time %d (%s), end time
%d (%s)", device,
+ String.format("| | | | |--device %s, start time %d (%s), end
time %d (%s)", device,
resource.getStartTimeMap().get(device), DatetimeUtils
.convertMillsecondToZonedDateTime(resource.getStartTimeMap().get(device)),
resource.getEndTimeMap().get(device), DatetimeUtils