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/10/19 09:52:43 UTC

[GitHub] [iotdb] qiaojialin commented on a change in pull request #4166: [IOTDB-1361] Support delete an aligned timeseries

qiaojialin commented on a change in pull request #4166:
URL: https://github.com/apache/iotdb/pull/4166#discussion_r731685183



##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/PartialPath.java
##########
@@ -134,8 +134,15 @@ public String getTailNode() {
    * @return A new PartialPath with altered prefix
    */
   public PartialPath alterPrefixPath(PartialPath prefixPath) {

Review comment:
       add test cases

##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/mnode/IMNode.java
##########
@@ -67,7 +67,7 @@
 
   void setSchemaTemplate(Template schemaTemplate);
 
-  int getMeasurementMNodeCount();
+  boolean isEmptyInternal();

Review comment:
       what is emptyInternal?
   
   isInternalMNode?

##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/mnode/IEntityMNode.java
##########
@@ -58,4 +58,20 @@ static IEntityMNode setToEntity(IMNode node) {
     }
     return entityMNode;
   }
+
+  static IMNode setToInternal(IEntityMNode entityMNode) {

Review comment:
       add javadoc: when to use this
   
   put this method to MetaUtils

##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/utils/MetaUtils.java
##########
@@ -112,6 +113,9 @@ public static PartialPath getStorageGroupPathByLevel(PartialPath path, int level
    * @return measurement names. For example: [s1, s2, s3]
    */
   public static List<String> getMeasurementsInPartialPath(PartialPath fullPath) {

Review comment:
       ```suggestion
     public static List<String> getFlatMeasurements(PartialPath fullPath) {
   ```
   
   Maybe getFlatMeasurements should be a method in PartialPath

##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/PartialPath.java
##########
@@ -134,8 +134,15 @@ public String getTailNode() {
    * @return A new PartialPath with altered prefix
    */
   public PartialPath alterPrefixPath(PartialPath prefixPath) {
-    String[] newNodes = Arrays.copyOf(nodes, Math.max(nodes.length, prefixPath.getNodeLength()));
-    System.arraycopy(prefixPath.getNodes(), 0, newNodes, 0, prefixPath.getNodeLength());
+    int newLength = Math.max(nodes.length, prefixPath.getNodeLength());
+    int startIndex = Math.min(nodes.length, prefixPath.getNodeLength());
+    if (nodes[startIndex - 1].equals(MULTI_LEVEL_PATH_WILDCARD)) {

Review comment:
       add javadoc




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