You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ea...@apache.org on 2019/04/04 13:47:55 UTC
[incubator-iotdb] branch reformat_mmanager_tostring updated: update
ut
This is an automated email from the ASF dual-hosted git repository.
east pushed a commit to branch reformat_mmanager_tostring
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/reformat_mmanager_tostring by this push:
new 71f7d18 update ut
71f7d18 is described below
commit 71f7d187205e5014cea3951516cc0ac2333d6ec1
Author: mdf369 <95...@qq.com>
AuthorDate: Thu Apr 4 21:47:42 2019 +0800
update ut
---
.../java/org/apache/iotdb/db/metadata/MTree.java | 4 +-
.../iotdb/db/integration/IoTDBCompleteIT.java | 154 +++++++++++----------
.../iotdb/db/integration/IoTDBMetadataFetchIT.java | 45 +++---
3 files changed, 108 insertions(+), 95 deletions(-)
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/metadata/MTree.java b/iotdb/src/main/java/org/apache/iotdb/db/metadata/MTree.java
index a000de6..f2a2ecf 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/metadata/MTree.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/metadata/MTree.java
@@ -1025,7 +1025,9 @@ public class MTree implements Serializable {
}
private JSONObject toJson() {
- return mnodeToJSON(getRoot());
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put(getRoot().getName(), mnodeToJSON(getRoot()));
+ return jsonObject;
}
private JSONObject mnodeToJSON(MNode node) {
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBCompleteIT.java b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBCompleteIT.java
index 34bc509..e359eda 100644
--- a/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBCompleteIT.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBCompleteIT.java
@@ -71,25 +71,29 @@ public class IoTDBCompleteIT {
"SHOW TIMESERIES",
"=== Timeseries Tree ===\n"
+ "\n"
- + "root:{\n"
- + " vehicle:{\n"
- + " d0:{\n"
- + " s0:{\n"
- + " DataType: INT32,\n"
- + " Encoding: RLE,\n"
- + " Compressor: UNCOMPRESSED,\n"
- + " args: {},\n"
- + " StorageGroup: root.vehicle\n"
- + " }\n"
- + " }\n"
- + " }\n"
+ + "{\n"
+ + "\t\"root\":{\n"
+ + "\t\t\"vehicle\":{\n"
+ + "\t\t\t\"d0\":{\n"
+ + "\t\t\t\t\"s0\":{\n"
+ + "\t\t\t\t\t\"args\":\"{}\",\n"
+ + "\t\t\t\t\t\"StorageGroup\":\"root.vehicle\",\n"
+ + "\t\t\t\t\t\"DataType\":\"INT32\",\n"
+ + "\t\t\t\t\t\"Compressor\":\"UNCOMPRESSED\",\n"
+ + "\t\t\t\t\t\"Encoding\":\"RLE\"\n"
+ + "\t\t\t\t}\n"
+ + "\t\t\t}\n"
+ + "\t\t}\n"
+ + "\t}\n"
+ "}",
"DELETE TIMESERIES root.vehicle.d0.s0",
"SHOW TIMESERIES",
"=== Timeseries Tree ===\n"
+ "\n"
- + "root:{\n"
- + " vehicle\n"
+ + "{\n"
+ + "\t\"root\":{\n"
+ + "\t\t\"vehicle\":{}\n"
+ + "\t}\n"
+ "}",
"CREATE TIMESERIES root.vehicle.d0.s0 WITH DATATYPE=BOOLEAN,ENCODING=PLAIN",
"CREATE TIMESERIES root.vehicle.d0.s1 WITH DATATYPE=INT64,ENCODING=TS_2DIFF",
@@ -105,70 +109,74 @@ public class IoTDBCompleteIT {
"SHOW TIMESERIES",
"=== Timeseries Tree ===\n"
+ "\n"
- + "root:{\n"
- + " vehicle:{\n"
- + " d1:{\n"
- + " s5:{\n"
- + " DataType: TEXT,\n"
- + " Encoding: PLAIN,\n"
- + " Compressor: UNCOMPRESSED,\n"
- + " args: {},\n"
- + " StorageGroup: root.vehicle\n"
- + " }\n"
- + " },\n"
- + " d2:{\n"
- + " s6:{\n"
- + " DataType: INT32,\n"
- + " Encoding: TS_2DIFF,\n"
- + " Compressor: UNCOMPRESSED,\n"
- + " args: {},\n"
- + " StorageGroup: root.vehicle\n"
- + " }\n"
- + " },\n"
- + " d3:{\n"
- + " s7:{\n"
- + " DataType: INT32,\n"
- + " Encoding: RLE,\n"
- + " Compressor: SNAPPY,\n"
- + " args: {},\n"
- + " StorageGroup: root.vehicle\n"
- + " }\n"
- + " },\n"
- + " d4:{\n"
- + " s8:{\n"
- + " DataType: INT32,\n"
- + " Encoding: RLE,\n"
- + " Compressor: UNCOMPRESSED,\n"
- + " args: {max_point_number=100},\n"
- + " StorageGroup: root.vehicle\n"
- + " }\n"
- + " },\n"
- + " d5:{\n"
- + " s9:{\n"
- + " DataType: FLOAT,\n"
- + " Encoding: PLAIN,\n"
- + " Compressor: SNAPPY,\n"
- + " args: {max_point_number=10},\n"
- + " StorageGroup: root.vehicle\n"
- + " }\n"
- + " },\n"
- + " d6:{\n"
- + " s10:{\n"
- + " DataType: DOUBLE,\n"
- + " Encoding: RLE,\n"
- + " Compressor: UNCOMPRESSED,\n"
- + " args: {max_point_number=10},\n"
- + " StorageGroup: root.vehicle\n"
- + " }\n"
- + " }\n"
- + " }\n"
+ + "{\n"
+ + "\t\"root\":{\n"
+ + "\t\t\"vehicle\":{\n"
+ + "\t\t\t\"d4\":{\n"
+ + "\t\t\t\t\"s8\":{\n"
+ + "\t\t\t\t\t\"args\":\"{max_point_number=100}\",\n"
+ + "\t\t\t\t\t\"StorageGroup\":\"root.vehicle\",\n"
+ + "\t\t\t\t\t\"DataType\":\"INT32\",\n"
+ + "\t\t\t\t\t\"Compressor\":\"UNCOMPRESSED\",\n"
+ + "\t\t\t\t\t\"Encoding\":\"RLE\"\n"
+ + "\t\t\t\t}\n"
+ + "\t\t\t},\n"
+ + "\t\t\t\"d5\":{\n"
+ + "\t\t\t\t\"s9\":{\n"
+ + "\t\t\t\t\t\"args\":\"{max_point_number=10}\",\n"
+ + "\t\t\t\t\t\"StorageGroup\":\"root.vehicle\",\n"
+ + "\t\t\t\t\t\"DataType\":\"FLOAT\",\n"
+ + "\t\t\t\t\t\"Compressor\":\"SNAPPY\",\n"
+ + "\t\t\t\t\t\"Encoding\":\"PLAIN\"\n"
+ + "\t\t\t\t}\n"
+ + "\t\t\t},\n"
+ + "\t\t\t\"d6\":{\n"
+ + "\t\t\t\t\"s10\":{\n"
+ + "\t\t\t\t\t\"args\":\"{max_point_number=10}\",\n"
+ + "\t\t\t\t\t\"StorageGroup\":\"root.vehicle\",\n"
+ + "\t\t\t\t\t\"DataType\":\"DOUBLE\",\n"
+ + "\t\t\t\t\t\"Compressor\":\"UNCOMPRESSED\",\n"
+ + "\t\t\t\t\t\"Encoding\":\"RLE\"\n"
+ + "\t\t\t\t}\n"
+ + "\t\t\t},\n"
+ + "\t\t\t\"d1\":{\n"
+ + "\t\t\t\t\"s5\":{\n"
+ + "\t\t\t\t\t\"args\":\"{}\",\n"
+ + "\t\t\t\t\t\"StorageGroup\":\"root.vehicle\",\n"
+ + "\t\t\t\t\t\"DataType\":\"TEXT\",\n"
+ + "\t\t\t\t\t\"Compressor\":\"UNCOMPRESSED\",\n"
+ + "\t\t\t\t\t\"Encoding\":\"PLAIN\"\n"
+ + "\t\t\t\t}\n"
+ + "\t\t\t},\n"
+ + "\t\t\t\"d2\":{\n"
+ + "\t\t\t\t\"s6\":{\n"
+ + "\t\t\t\t\t\"args\":\"{}\",\n"
+ + "\t\t\t\t\t\"StorageGroup\":\"root.vehicle\",\n"
+ + "\t\t\t\t\t\"DataType\":\"INT32\",\n"
+ + "\t\t\t\t\t\"Compressor\":\"UNCOMPRESSED\",\n"
+ + "\t\t\t\t\t\"Encoding\":\"TS_2DIFF\"\n"
+ + "\t\t\t\t}\n"
+ + "\t\t\t},\n"
+ + "\t\t\t\"d3\":{\n"
+ + "\t\t\t\t\"s7\":{\n"
+ + "\t\t\t\t\t\"args\":\"{}\",\n"
+ + "\t\t\t\t\t\"StorageGroup\":\"root.vehicle\",\n"
+ + "\t\t\t\t\t\"DataType\":\"INT32\",\n"
+ + "\t\t\t\t\t\"Compressor\":\"SNAPPY\",\n"
+ + "\t\t\t\t\t\"Encoding\":\"RLE\"\n"
+ + "\t\t\t\t}\n"
+ + "\t\t\t}\n"
+ + "\t\t}\n"
+ + "\t}\n"
+ "}",
"DELETE TIMESERIES root.vehicle.*",
"SHOW TIMESERIES",
"=== Timeseries Tree ===\n"
+ "\n"
- + "root:{\n"
- + " vehicle\n"
+ + "{\n"
+ + "\t\"root\":{\n"
+ + "\t\t\"vehicle\":{}\n"
+ + "\t}\n"
+ "}"
};
executeSQL(sqlS);
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
index 830328c..355b2af 100644
--- a/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
@@ -360,28 +360,31 @@ public class IoTDBMetadataFetchIT {
String standard =
"=== Timeseries Tree ===\n"
+ "\n"
- + "root:{\n"
- + " ln:{\n"
- + " wf01:{\n"
- + " wt01:{\n"
- + " status:{\n"
- + " DataType: BOOLEAN,\n"
- + " Encoding: PLAIN,\n"
- + " Compressor: UNCOMPRESSED,\n"
- + " args: {},\n"
- + " StorageGroup: root.ln.wf01.wt01\n"
- + " },\n"
- + " temperature:{\n"
- + " DataType: FLOAT,\n"
- + " Encoding: RLE,\n"
- + " Compressor: SNAPPY,\n"
- + " args: {max_point_number=3},\n"
- + " StorageGroup: root.ln.wf01.wt01\n"
- + " }\n"
- + " }\n"
- + " }\n"
- + " }\n"
+ + "{\n"
+ + "\t\"root\":{\n"
+ + "\t\t\"ln\":{\n"
+ + "\t\t\t\"wf01\":{\n"
+ + "\t\t\t\t\"wt01\":{\n"
+ + "\t\t\t\t\t\"temperature\":{\n"
+ + "\t\t\t\t\t\t\"args\":\"{max_point_number=3}\",\n"
+ + "\t\t\t\t\t\t\"StorageGroup\":\"root.ln.wf01.wt01\",\n"
+ + "\t\t\t\t\t\t\"DataType\":\"FLOAT\",\n"
+ + "\t\t\t\t\t\t\"Compressor\":\"SNAPPY\",\n"
+ + "\t\t\t\t\t\t\"Encoding\":\"RLE\"\n"
+ + "\t\t\t\t\t},\n"
+ + "\t\t\t\t\t\"status\":{\n"
+ + "\t\t\t\t\t\t\"args\":\"{}\",\n"
+ + "\t\t\t\t\t\t\"StorageGroup\":\"root.ln.wf01.wt01\",\n"
+ + "\t\t\t\t\t\t\"DataType\":\"BOOLEAN\",\n"
+ + "\t\t\t\t\t\t\"Compressor\":\"UNCOMPRESSED\",\n"
+ + "\t\t\t\t\t\t\"Encoding\":\"PLAIN\"\n"
+ + "\t\t\t\t\t}\n"
+ + "\t\t\t\t}\n"
+ + "\t\t\t}\n"
+ + "\t\t}\n"
+ + "\t}\n"
+ "}";
+
Assert.assertEquals(standard, metadataInJson);
}
}