[ 
https://issues.apache.org/jira/browse/RANGER-3469?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Madhan Neethiraj resolved RANGER-3469.
--------------------------------------
    Fix Version/s: 3.0.0
                   2.4.0
       Resolution: Fixed

> Off-By-One Error in XUser Syncing
> ---------------------------------
>
>                 Key: RANGER-3469
>                 URL: https://issues.apache.org/jira/browse/RANGER-3469
>             Project: Ranger
>          Issue Type: Improvement
>          Components: Ranger
>            Reporter: David Mollitor
>            Priority: Minor
>             Fix For: 3.0.0, 2.4.0
>
>
> {code:java|title=PolicyMgrUserGroupBuilder.java}
> int uploadedCount = -1;
> int pageSize = Integer.valueOf(recordsToPullPerCall);
> while (uploadedCount < totalCount) {
>       ...
>       GetXGroupListResponse pagedXGroupList = new GetXGroupListResponse();
>       int pagedXGroupListLen = uploadedCount+pageSize;
>       
> pagedXGroupList.setXgroupInfoList(xGroupList.getXgroupInfoList().subList(uploadedCount+1,pagedXGroupListLen>totalCount?totalCount:pagedXGroupListLen));
> {code}
> The size of the first batch of users to sync is:
> {code:java}
> int uploadedCount = -1;
> // default in value is 1000
> int pageSize = Integer.valueOf(recordsToPullPerCall);
> // value is 1000 + -1 = 999
> int pagedXGroupListLen = uploadedCount+pageSize;
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to