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 2021/11/16 15:17:20 UTC

[GitHub] [iotdb] SilverNarcissus commented on a change in pull request #4391: [IOTDB-1931] Adapt tree structrued Template with MManager

SilverNarcissus commented on a change in pull request #4391:
URL: https://github.com/apache/iotdb/pull/4391#discussion_r750373642



##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/MManager.java
##########
@@ -1721,11 +1721,31 @@ public void deleteLastCacheByDevice(
   @SuppressWarnings("squid:S3776") // Suppress high Cognitive Complexity warning
   public IMNode getSeriesSchemasAndReadLockDevice(InsertPlan plan)
       throws MetadataException, IOException {
+    // devicePath is a logical path which is parent of measurement, whether in template or not
     PartialPath devicePath = plan.getDeviceId();
     String[] measurementList = plan.getMeasurements();
     IMeasurementMNode[] measurementMNodes = plan.getMeasurementMNodes();
 
-    // 1. get device node
+    // 1. get device node, set using template if accessed.
+

Review comment:
       remove this empty line

##########
File path: server/src/test/java/org/apache/iotdb/db/metadata/MManagerBasicTest.java
##########
@@ -869,11 +871,13 @@ public void testTemplate() throws MetadataException {
         new UnaryMeasurementSchema("s11", TSDataType.INT64, TSEncoding.RLE, CompressionType.SNAPPY);
     assertNotNull(node.getSchemaTemplate());
 
-    Set<IMeasurementSchema> allSchema =
-        new HashSet<>(node.getSchemaTemplate().getSchemaMap().values());
+    Set<String> allSchema = new HashSet<>();
+    for (IMeasurementSchema schema : node.getSchemaTemplate().getSchemaMap().values()) {
+      allSchema.add("root.sg1.d1" + TsFileConstant.PATH_SEPARATOR + schema.getMeasurementId());
+    }
     for (MeasurementPath measurementPath :
-        manager.getMeasurementPaths(new PartialPath("root.sg1.d1.*"))) {
-      allSchema.remove(measurementPath.getMeasurementSchema());
+        manager.getMeasurementPaths(new PartialPath("root.sg1.d1.**"))) {

Review comment:
       What's the ** means currently? Maybe I miss something in the design part.




-- 
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