You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Abhay Kulkarni <ak...@hortonworks.com> on 2022/09/19 01:40:55 UTC
Review Request 74124: RANGER-3913: Reduce number of calls to FilenameUtils.wildcardMatch() when evaluating resource matching
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74124/
-----------------------------------------------------------
Review request for ranger, Madhan Neethiraj, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.
Bugs: RANGER-3913
https://issues.apache.org/jira/browse/RANGER-3913
Repository: ranger
Description
-------
When evaluating resource matching for a path-type resource in a recursive policy containing wildcards, several calls may be made to Hadoop library function FilenameUtils.wildcardMatch(). These calls may be expensive and minimizing such calls may help improve policy evaluation performance.
Diffs
-----
agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerPathResourceMatcher.java a95b1f73f
Diff: https://reviews.apache.org/r/74124/diff/1/
Testing
-------
Compiled clean, ran all unit tests successfully.
Thanks,
Abhay Kulkarni
Re: Review Request 74124: RANGER-3913: Reduce number of calls to FilenameUtils.wildcardMatch() when evaluating resource matching
Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74124/#review224705
-----------------------------------------------------------
Fix it, then Ship it!
agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerPathResourceMatcher.java
Line 159 (original), 159 (patched)
<https://reviews.apache.org/r/74124/#comment313488>
It will help to avoid creation of wildcardPathElements in every call to isRecursiveWildCardMatch().
Consider creating & caching wildcardPathElements in RecursiveWildcardResourceMatcher constructor and send this to isRecursiveWildCardMatch() as an argument - similar to wildcardPath.
Note that such caching should be done only when wildcardPath doesn't have any macros/tokens - like {USER}, ${{USER.dept}}). When wildcardPath does have such macros/tokens, wildcardPathElements can be created in RecursiveWildcardResourceMatcher.isMatch(), instead of the constructor.
- Madhan Neethiraj
On Sept. 19, 2022, 1:40 a.m., Abhay Kulkarni wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74124/
> -----------------------------------------------------------
>
> (Updated Sept. 19, 2022, 1:40 a.m.)
>
>
> Review request for ranger, Madhan Neethiraj, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.
>
>
> Bugs: RANGER-3913
> https://issues.apache.org/jira/browse/RANGER-3913
>
>
> Repository: ranger
>
>
> Description
> -------
>
> When evaluating resource matching for a path-type resource in a recursive policy containing wildcards, several calls may be made to Hadoop library function FilenameUtils.wildcardMatch(). These calls may be expensive and minimizing such calls may help improve policy evaluation performance.
>
>
> Diffs
> -----
>
> agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerPathResourceMatcher.java a95b1f73f
>
>
> Diff: https://reviews.apache.org/r/74124/diff/1/
>
>
> Testing
> -------
>
> Compiled clean, ran all unit tests successfully.
>
>
> Thanks,
>
> Abhay Kulkarni
>
>
Re: Review Request 74124: RANGER-3913: Reduce number of calls to FilenameUtils.wildcardMatch() when evaluating resource matching
Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74124/#review224713
-----------------------------------------------------------
Ship it!
Ship It!
- Madhan Neethiraj
On Sept. 27, 2022, 6:13 p.m., Abhay Kulkarni wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74124/
> -----------------------------------------------------------
>
> (Updated Sept. 27, 2022, 6:13 p.m.)
>
>
> Review request for ranger, Madhan Neethiraj, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.
>
>
> Bugs: RANGER-3913
> https://issues.apache.org/jira/browse/RANGER-3913
>
>
> Repository: ranger
>
>
> Description
> -------
>
> When evaluating resource matching for a path-type resource in a recursive policy containing wildcards, several calls may be made to Hadoop library function FilenameUtils.wildcardMatch(). These calls may be expensive and minimizing such calls may help improve policy evaluation performance.
>
>
> Diffs
> -----
>
> agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerPathResourceMatcher.java a95b1f73f
>
>
> Diff: https://reviews.apache.org/r/74124/diff/2/
>
>
> Testing
> -------
>
> Compiled clean, ran all unit tests successfully.
>
>
> Thanks,
>
> Abhay Kulkarni
>
>
Re: Review Request 74124: RANGER-3913: Reduce number of calls to FilenameUtils.wildcardMatch() when evaluating resource matching
Posted by Abhay Kulkarni <ak...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74124/
-----------------------------------------------------------
(Updated Sept. 27, 2022, 6:13 p.m.)
Review request for ranger, Madhan Neethiraj, Ramesh Mani, Sailaja Polavarapu, and Velmurugan Periasamy.
Changes
-------
Addressed review comment
Bugs: RANGER-3913
https://issues.apache.org/jira/browse/RANGER-3913
Repository: ranger
Description
-------
When evaluating resource matching for a path-type resource in a recursive policy containing wildcards, several calls may be made to Hadoop library function FilenameUtils.wildcardMatch(). These calls may be expensive and minimizing such calls may help improve policy evaluation performance.
Diffs (updated)
-----
agents-common/src/main/java/org/apache/ranger/plugin/resourcematcher/RangerPathResourceMatcher.java a95b1f73f
Diff: https://reviews.apache.org/r/74124/diff/2/
Changes: https://reviews.apache.org/r/74124/diff/1-2/
Testing
-------
Compiled clean, ran all unit tests successfully.
Thanks,
Abhay Kulkarni