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