> On Feb. 17, 2020, 1:31 a.m., Pradeep Agrawal wrote: > > security-admin/src/main/java/org/apache/ranger/db/XXGroupDao.java > > Lines 76 (patched) > > <https://reviews.apache.org/r/72142/diff/1/?file=2211449#file2211449line77> > > > > Try to use CollectionUtils.isEmpty(groupNames) here from package > > org.apache.commons.collections; > > > > update the same in other places also.
Thanks, will fix. > On Feb. 17, 2020, 1:31 a.m., Pradeep Agrawal wrote: > > security-admin/src/main/java/org/apache/ranger/db/XXGroupDao.java > > Lines 77 (patched) > > <https://reviews.apache.org/r/72142/diff/1/?file=2211449#file2211449line78> > > > > if possible avoid multiple return statements from the same method. I just followed the structure of the existing findByGroupName/findByRoleName/findByUserName functions. I can change it if you believe this is the right way, let me know what you prefer. - Andrew ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/72142/#review219598 ----------------------------------------------------------- On Feb. 16, 2020, 10:48 p.m., Andrew Luo wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/72142/ > ----------------------------------------------------------- > > (Updated Feb. 16, 2020, 10:48 p.m.) > > > Review request for ranger. > > > Bugs: RANGER-2732 > https://issues.apache.org/jira/browse/RANGER-2732 > > > Repository: ranger > > > Description > ------- > > Getting the ID for each role/group/user one-by-one is slow, especially for > large policies with many roles/groups/users. Batching significantly improves > performance. > > > Diffs > ----- > > security-admin/src/main/java/org/apache/ranger/biz/PolicyRefUpdater.java > 318f9f505 > security-admin/src/main/java/org/apache/ranger/db/XXGroupDao.java 1bd59f8d2 > security-admin/src/main/java/org/apache/ranger/db/XXRoleDao.java 8528652fc > security-admin/src/main/java/org/apache/ranger/db/XXUserDao.java cea90c165 > security-admin/src/main/resources/META-INF/jpa_named_queries.xml f23bf2e65 > > > Diff: https://reviews.apache.org/r/72142/diff/1/ > > > Testing > ------- > > Tested end-to-end. Verified that missing users are created, and existing > users are correctly added to policies. > > > Thanks, > > Andrew Luo > >
