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/08/15 09:20:48 UTC

[GitHub] [iotdb] MarcosZyk commented on a diff in pull request #6947: [IOTDB-3465] ext pipe support DeletionPipeData

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


##########
node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java:
##########
@@ -254,60 +254,87 @@ private boolean alterPrefixPathInternal(
   }
 
   /**
-   * Test if this PartialPath matches a full path. This partialPath acts as a full path pattern.
-   * rPath is supposed to be a full timeseries path without wildcards. e.g. "root.sg.device.*"
-   * matches path "root.sg.device.s1" whereas it does not match "root.sg.device" and
-   * "root.sg.vehicle.s1"
+   * Test if current PartialPath matches a full path. Current partialPath acts as a full path
+   * pattern. rPath is supposed to be a full timeseries path without wildcards. e.g.
+   * "root.sg.device.*" matches path "root.sg.device.s1" whereas it does not match "root.sg.device"
+   * and "root.sg.vehicle.s1"
    *
    * @param rPath a plain full path of a timeseries
    * @return true if a successful match, otherwise return false
    */
   public boolean matchFullPath(PartialPath rPath) {
-    return matchFullPath(rPath.getNodes(), 0, 0, false);
+    return matchPath(rPath.getNodes(), 0, 0, false, false);
   }
 
-  private boolean matchFullPath(
-      String[] pathNodes, int pathIndex, int patternIndex, boolean multiLevelWild) {
+  /**
+   * Check if current pattern PartialPath can match 1 prefix path.
+   *
+   * <p>1) Current partialPath acts as a full path pattern.
+   *
+   * <p>2) Input parameter prefixPath is 1 prefix of time-series path.
+   *
+   * <p>For example:
+   *
+   * <p>1) Pattern "root.sg1.d1.*" can matche prefix path "root.sg1.d1.s1", "root.sg1.d1",
+   * "root.sg1", "root" etc.
+   *
+   * <p>1) Pattern "root.sg1.d1.*" does not match prefix path "root.sg2", "root.sg1.d2".
+   *
+   * @param prefixPath
+   * @return
+   */
+  public boolean matchPrefixPath(PartialPath prefixPath) {
+    return matchPath(prefixPath.getNodes(), 0, 0, false, true);
+  }

Review Comment:
   Please correct some syntax mistakes. 
   
   It seems this interface has different behavior from the old one and the old one has been renamed to ```prefixMatchFullPath```. The names are confusing.



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