You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Madhan Neethiraj <ma...@apache.org> on 2022/10/01 00:38:23 UTC
Re: Review Request 74144: RANGER-3934: optimization in loading of tags into cache
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74144/
-----------------------------------------------------------
(Updated Oct. 1, 2022, 12:38 a.m.)
Review request for ranger, Ankita Sinha, Kishor Gollapalliwar, Abhay Kulkarni, Mehul Parikh, Pradeep Agrawal, Ramesh Mani, Sailaja Polavarapu, Subhrat Chaudhary, and Velmurugan Periasamy.
Changes
-------
addressed review comments
Bugs: RANGER-3934
https://issues.apache.org/jira/browse/RANGER-3934
Repository: ranger
Description
-------
- updated several retrieval of XXService JPA object by replacing with retrival of serviceId
- replaced several instances of Map<Long, Long> with Set<Long>, as these instances had same value for key and value
- avoided expensive calls to RangerTagResourceMapService.getByTagId(tagId) and RangerTagResourceMapService.getTagIdsForResourceId(serviceResourceId)
- updated several methods in XXTagResourceMapDao to avoid loading of XXTagResourceMap JPA object; instead created XXTagResourceMap object from individial fields retrieved from query
Diffs (updated)
-----
agents-common/src/main/java/org/apache/ranger/plugin/model/RangerTagDef.java c787beca5
agents-common/src/main/java/org/apache/ranger/plugin/util/RangerServiceTagsDeltaUtil.java 8d9241c1c
security-admin/src/main/java/org/apache/ranger/biz/TagDBStore.java d8154b7de
security-admin/src/main/java/org/apache/ranger/db/XXRMSServiceResourceDao.java afa754ba2
security-admin/src/main/java/org/apache/ranger/db/XXServiceDao.java 3cc3d9cef
security-admin/src/main/java/org/apache/ranger/db/XXTagResourceMapDao.java 3f8b5b718
security-admin/src/main/java/org/apache/ranger/patch/PatchForAtlasServiceDefUpdate_J10013.java b0f71e138
security-admin/src/main/java/org/apache/ranger/rest/TagREST.java c7cf3bfb8
security-admin/src/main/resources/META-INF/jpa_named_queries.xml e4a2354b0
Diff: https://reviews.apache.org/r/74144/diff/5/
Changes: https://reviews.apache.org/r/74144/diff/4-5/
Testing
-------
- with Ranger database having ~1m service-resources, ~2m tags and delta of 20k resource & 40k tags:
-- before these optmizations, tag-cache update from delta didn't complete event after a long time (1h35m)
-- with these optmizations, tag-cache update from the same delta completed within 10 minutes
- there is scope for further optimization RangerServiceTagsDeltaUtil.applyDelta() - as this took almost 97% time in updating the cache (588 seconds); compare this to TagDBStore.getServiceTagsDelta() which completed in 13 seeconds
Thanks,
Madhan Neethiraj
Re: Review Request 74144: RANGER-3934: optimization in loading of tags into cache
Posted by Abhay Kulkarni <ak...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74144/#review224734
-----------------------------------------------------------
Ship it!
Please update the tests run and the improvements seen after optimizing applyDelta() function.
- Abhay Kulkarni
On Oct. 1, 2022, 12:38 a.m., Madhan Neethiraj wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74144/
> -----------------------------------------------------------
>
> (Updated Oct. 1, 2022, 12:38 a.m.)
>
>
> Review request for ranger, Ankita Sinha, Kishor Gollapalliwar, Abhay Kulkarni, Mehul Parikh, Pradeep Agrawal, Ramesh Mani, Sailaja Polavarapu, Subhrat Chaudhary, and Velmurugan Periasamy.
>
>
> Bugs: RANGER-3934
> https://issues.apache.org/jira/browse/RANGER-3934
>
>
> Repository: ranger
>
>
> Description
> -------
>
> - updated several retrieval of XXService JPA object by replacing with retrival of serviceId
> - replaced several instances of Map<Long, Long> with Set<Long>, as these instances had same value for key and value
> - avoided expensive calls to RangerTagResourceMapService.getByTagId(tagId) and RangerTagResourceMapService.getTagIdsForResourceId(serviceResourceId)
> - updated several methods in XXTagResourceMapDao to avoid loading of XXTagResourceMap JPA object; instead created XXTagResourceMap object from individial fields retrieved from query
>
>
> Diffs
> -----
>
> agents-common/src/main/java/org/apache/ranger/plugin/model/RangerTagDef.java c787beca5
> agents-common/src/main/java/org/apache/ranger/plugin/util/RangerServiceTagsDeltaUtil.java 8d9241c1c
> security-admin/src/main/java/org/apache/ranger/biz/TagDBStore.java d8154b7de
> security-admin/src/main/java/org/apache/ranger/db/XXRMSServiceResourceDao.java afa754ba2
> security-admin/src/main/java/org/apache/ranger/db/XXServiceDao.java 3cc3d9cef
> security-admin/src/main/java/org/apache/ranger/db/XXTagResourceMapDao.java 3f8b5b718
> security-admin/src/main/java/org/apache/ranger/patch/PatchForAtlasServiceDefUpdate_J10013.java b0f71e138
> security-admin/src/main/java/org/apache/ranger/rest/TagREST.java c7cf3bfb8
> security-admin/src/main/resources/META-INF/jpa_named_queries.xml e4a2354b0
>
>
> Diff: https://reviews.apache.org/r/74144/diff/6/
>
>
> Testing
> -------
>
> - with Ranger database having ~1m service-resources, ~2m tags and delta of 20k resource & 40k tags:
> -- before these optmizations, tag-cache update from delta didn't complete event after a long time (1h35m)
> -- with these optmizations, tag-cache update from the same delta completed within 10 minutes
> - there is scope for further optimization RangerServiceTagsDeltaUtil.applyDelta() - as this took almost 97% time in updating the cache (588 seconds); compare this to TagDBStore.getServiceTagsDelta() which completed in 13 seeconds
>
>
> Thanks,
>
> Madhan Neethiraj
>
>
Re: Review Request 74144: RANGER-3934: optimization in loading of tags into cache
Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74144/
-----------------------------------------------------------
(Updated Oct. 3, 2022, 6:34 p.m.)
Review request for ranger, Ankita Sinha, Kishor Gollapalliwar, Abhay Kulkarni, Mehul Parikh, Pradeep Agrawal, Ramesh Mani, Sailaja Polavarapu, Subhrat Chaudhary, and Velmurugan Periasamy.
Changes
-------
updated test stats
Bugs: RANGER-3934
https://issues.apache.org/jira/browse/RANGER-3934
Repository: ranger
Description
-------
- updated several retrieval of XXService JPA object by replacing with retrival of serviceId
- replaced several instances of Map<Long, Long> with Set<Long>, as these instances had same value for key and value
- avoided expensive calls to RangerTagResourceMapService.getByTagId(tagId) and RangerTagResourceMapService.getTagIdsForResourceId(serviceResourceId)
- updated several methods in XXTagResourceMapDao to avoid loading of XXTagResourceMap JPA object; instead created XXTagResourceMap object from individial fields retrieved from query
Diffs
-----
agents-common/src/main/java/org/apache/ranger/plugin/model/RangerTagDef.java c787beca5
agents-common/src/main/java/org/apache/ranger/plugin/util/RangerServiceTagsDeltaUtil.java 8d9241c1c
security-admin/src/main/java/org/apache/ranger/biz/TagDBStore.java d8154b7de
security-admin/src/main/java/org/apache/ranger/db/XXRMSServiceResourceDao.java afa754ba2
security-admin/src/main/java/org/apache/ranger/db/XXServiceDao.java 3cc3d9cef
security-admin/src/main/java/org/apache/ranger/db/XXTagResourceMapDao.java 3f8b5b718
security-admin/src/main/java/org/apache/ranger/patch/PatchForAtlasServiceDefUpdate_J10013.java b0f71e138
security-admin/src/main/java/org/apache/ranger/rest/TagREST.java c7cf3bfb8
security-admin/src/main/resources/META-INF/jpa_named_queries.xml e4a2354b0
Diff: https://reviews.apache.org/r/74144/diff/6/
Testing (updated)
-------
- with Ranger database having ~1m service-resources, ~2m tags and delta of 20k resource & 40k tags:
-- before these optmizations, tag-cache update from delta didn't complete event after a long time (1h35m)
-- with these optmizations, tag-cache update from the same delta completed within 15 seconds
Thanks,
Madhan Neethiraj