-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74678/#review225870
-----------------------------------------------------------




security-admin/src/main/java/org/apache/ranger/biz/GdsDBStore.java
Lines 1398 (patched)
<https://reviews.apache.org/r/74678/#comment314283>

    This will result one additional DB query for every datashare found - see 
#1415 below. It seems the purpose of excludeExisting is to get list of 
datashares that are not already associated with datasetId. If yes, consider an 
alternative approach to filter datashares. For example, instead of query-param 
'excludeExisting' consider 'excludeDatasetId', and use appropriate query to 
handle this filter.


- Madhan Neethiraj


On Oct. 17, 2023, 6:59 a.m., Prashant Satam wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74678/
> -----------------------------------------------------------
> 
> (Updated Oct. 17, 2023, 6:59 a.m.)
> 
> 
> Review request for ranger, Anand Nadar, Ankita Sinha, Madhan Neethiraj, 
> Monika Kachhadiya, and Subhrat Chaudhary.
> 
> 
> Bugs: RANGER-4397
>     https://issues.apache.org/jira/browse/RANGER-4397
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Dataset Details >> Add a Datashare >> List Datashares pop up,
> Need a GET API to get all datashares, based on LIST ACL for current user
> Exclude existing one for which request is is available GRANTED, ACTIVE, 
> REQUESTED states
> Response: id, Name, Descrption
> Request: datasetId, excludeExistingDataShare
> Filter: partial search on datashare name, Pagination
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/util/SearchFilter.java 
> 93bd7f73d 
>   security-admin/src/main/java/org/apache/ranger/biz/GdsDBStore.java 
> 10986823d 
>   security-admin/src/main/java/org/apache/ranger/common/RangerSearchUtil.java 
> 719d8a900 
> 
> 
> Diff: https://reviews.apache.org/r/74678/diff/1/
> 
> 
> Testing
> -------
> 
> 1)Create 1 dataset
> 2)create 2 dataShares
> 3)Link 1st dataset to 1st dataShare
> 4)Get dataShares by GET-API(/service/gds/datashare/) using query param 
> excludeExisting=true
> 5)You will only get dataShares which are not mapped to any dataset
> 
> Request-------------> 
> (/service/gds/datashare/?excludeExisting=true&datasetId=1&dataShareNamePartial=RangerDataShare11)
> Response------------>
> {
>     "startIndex": 0,
>     "pageSize": 200,
>     "totalCount": 1,
>     "resultSize": 1,
>     "sortType": "dataShareId",
>     "sortBy": "asc",
>     "queryTimeMS": 1697525773619,
>     "list": [
>         {
>             "id": 3,
>             "guid": "cb7a8d8e-b082-4c4c-98c7-25b204e8b83c",
>             "isEnabled": true,
>             "createdBy": "Admin",
>             "updatedBy": "Admin",
>             "createTime": 1697525717000,
>             "updateTime": 1697525717000,
>             "version": 1,
>             "name": "RangerDataShare11",
>             "acl": {
>                 "users": {
>                     "admin": "ADMIN"
>                 }
>             },
>             "service": "Ranger_hive",
>             "zone": " "
>         }
>     ],
>     "listSize": 1
> }
> 
> 
> Thanks,
> 
> Prashant Satam
> 
>

Reply via email to