You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/05/03 09:46:47 UTC

[GitHub] [iotdb] MarcosZyk commented on a diff in pull request #5781: [IOTDB-3088]Implement MTreeAboveSG serialize and deserialize

MarcosZyk commented on code in PR #5781:
URL: https://github.com/apache/iotdb/pull/5781#discussion_r863622145


##########
server/src/test/java/org/apache/iotdb/db/metadata/mtree/MTreeAboveSGTest.java:
##########
@@ -289,4 +292,49 @@ public void testGetNodeListInLevel() throws MetadataException {
     Assert.assertEquals(0, result.left.size());
     Assert.assertEquals(1, result.right.size());
   }
+
+  @Test
+  public void testSerialization() throws Exception {
+    PartialPath[] pathList =
+        new PartialPath[] {
+          new PartialPath("root.sg"),
+          new PartialPath("root.a.sg"),
+          new PartialPath("root.a.b.sg"),
+          new PartialPath("root.a.a.b.sg")
+        };
+    for (int i = 0; i < pathList.length; i++) {
+      root.setStorageGroup(pathList[i]);
+      IStorageGroupMNode storageGroupMNode =
+          root.getStorageGroupNodeByStorageGroupPath(pathList[i]);
+      storageGroupMNode.setDataTTL(i);
+      storageGroupMNode.setDataReplicationFactor(i);
+      storageGroupMNode.setSchemaReplicationFactor(i);
+      storageGroupMNode.setTimePartitionInterval(i);
+    }
+
+    ByteBuffer byteBuffer = ByteBuffer.allocate(1024 * 1024);
+    root.serialize(byteBuffer);
+    byteBuffer.flip();
+
+    root.clear();
+
+    root.deserialize(byteBuffer);

Review Comment:
   Fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org