Skip to content

Implement intersect with prefix pattern for PartialPath and PathPatternTree#10874

Merged
JackieTien97 merged 4 commits intoapache:masterfrom
Cpaulyz:intersect
Aug 18, 2023
Merged

Implement intersect with prefix pattern for PartialPath and PathPatternTree#10874
JackieTien97 merged 4 commits intoapache:masterfrom
Cpaulyz:intersect

Conversation

@Cpaulyz
Copy link
Copy Markdown
Contributor

@Cpaulyz Cpaulyz commented Aug 16, 2023

Description

To support authorization, this PR implements two algorithms about intersection.

  • PartialPath
  /**
   * Generate a list of partial paths which are the intersection of this path pattern and input
   * prefix pattern.
   *
   * @param prefixPattern must be a prefix full path ending with one "**", like "root.sg.**"
   * @return a list of partial paths which are the intersection of this path pattern and input
   *     prefix pattern.
   */
  public List<PartialPath> intersectWithPrefixPattern(PartialPath prefixPattern);
  • PathPatternTree
  /**
   * Intersect the pattern tree with the full path prefix tree, and return the intersected pattern
   * tree.
   *
   * @param patternTree any pattern tree
   * @param fullPathPrefixTree the included pattern must be fullPath or prefix pattern(e.g.
   *     root.sg.**)
   * @return the intersected pattern tree
   */
  public static PathPatternTree intersectWithFullPathPrefixTree(PathPatternTree patternTree, PathPatternTree fullPathPrefixTree);

@Cpaulyz Cpaulyz requested a review from JackieTien97 August 18, 2023 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants