> On Sept. 15, 2021, 2:51 p.m., Madhan Neethiraj wrote: > > security-admin/src/main/java/org/apache/ranger/service/RangerPolicyServiceBase.java > > Lines 105 (patched) > > <https://reviews.apache.org/r/73545/diff/3/?file=2252819#file2252819line105> > > > > To avoid retrieval of entire XXServiceDef object for each policy, > > consider getting serviceType with the following call: > > String serviceType = > > daoMgr.getXXServiceDef().findServiceDefTypeByServiceId(xService.getId()); > > > > > > Alternately, consider adding method > > XXServiceDefDao.findServiceDefTypeByServiceDefId(), and use it here: > > String serviceType = > > daoMgr.getXXServiceDef().findServiceDefTypeByServiceDefId(xService.getType());
Thanks for the review. As the proposed patch is already committed i will address your suggestion in a separate jira. - Pradeep ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/73545/#review223488 ----------------------------------------------------------- On Sept. 14, 2021, 4:37 p.m., Pradeep Agrawal wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/73545/ > ----------------------------------------------------------- > > (Updated Sept. 14, 2021, 4:37 p.m.) > > > Review request for ranger and Abhay Kulkarni. > > > Bugs: RANGER-3371 > https://issues.apache.org/jira/browse/RANGER-3371 > > > Repository: ranger > > > Description > ------- > > **Problem Statement:** While saving policy object to json string, serviceType > is not being stored with policy json. > Due to this delta policies validation(RangerPolicyDeltaUtil.isValidDeltas()) > fails and delta policies are not returned, Since delta policy result is empty > ranger is fetching all ranger policies. > > **Proposed Solution:** Before converting policy object to json string, > serviceType field of the policy object can be updated, so that during the > object to json conversion serviceType field value is also added in policy > json. > > > Diffs > ----- > > security-admin/src/main/java/org/apache/ranger/db/XXPolicyChangeLogDao.java > 16aaf306c > > security-admin/src/main/java/org/apache/ranger/service/RangerPolicyServiceBase.java > 7ee829276 > > security-admin/src/test/java/org/apache/ranger/service/TestRangerPolicyServiceBase.java > ff8e90825 > > > Diff: https://reviews.apache.org/r/73545/diff/3/ > > > Testing > ------- > > With patch, tested policy creation and serviceType field and its value is > added in the policy text for the respective policy. > Further checked the delta policy and validation is passing. > > > Thanks, > > Pradeep Agrawal > >
