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

Ramachandran updated RANGER-3903:
---------------------------------
    Description: 
After going through the below code snippets in the master branch 
!screenshot-1.png!

>From the above code, we iterate delta policies and check if this policy exists 
>in the existing policy, we add that to deletePolicies list.

1st#Improvement:

If a delta change type is created, we expect that it should  be in the 
deletedPolicies list which will not happen.

So we need to add  changeType == RangerPolicyDelta.CHANGE_TYPE_POLICY_CREATE as 
part of the below block of code

!image-2022-11-08-09-22-05-188.png!
 2nd#Improvement:

problem:

>From the above code,we see for each element in the deltas ,we iterate policies 
>and check if this delta policy exists in the existing policy, we add that to 
>deletePolicies list.

Solution:

We need to use Map instead of iterating policies for every element of deltas 
--> Map<Long,List<RangerPolicy>> policiesIdMap
Building index map key will be policyId and value will be no of policies 
associated with the same policy Id

 

  was:
After going through the below code snippets in the master branch 
 !screenshot-1.png! 


>From the above code, we iterate delta policies and check if this policy exists 
>in the existing policy, we add that to deletePolicies list.

If a delta change type is created, we expect that it should  be in the 
deletedPolicies list which will not happen.

So we need to add  changeType == RangerPolicyDelta.CHANGE_TYPE_POLICY_CREATE as 
part of the below block of code
        !image-2022-11-08-09-22-05-188.png!


> Improvement in RangerPolicyDeltaUtil--> applyDeltas method
> ----------------------------------------------------------
>
>                 Key: RANGER-3903
>                 URL: https://issues.apache.org/jira/browse/RANGER-3903
>             Project: Ranger
>          Issue Type: Improvement
>          Components: Ranger
>    Affects Versions: 3.0.0
>            Reporter: Ramachandran
>            Assignee: Ramachandran
>            Priority: Major
>         Attachments: 
> 0001-RANGER-3903-Bug-in-RangerPolicyDeltaUtil-applyDeltas.patch, 
> image-2022-11-08-09-22-05-188.png, screenshot-1.png
>
>
> After going through the below code snippets in the master branch 
> !screenshot-1.png!
> From the above code, we iterate delta policies and check if this policy 
> exists in the existing policy, we add that to deletePolicies list.
> 1st#Improvement:
> If a delta change type is created, we expect that it should  be in the 
> deletedPolicies list which will not happen.
> So we need to add  changeType == RangerPolicyDelta.CHANGE_TYPE_POLICY_CREATE 
> as part of the below block of code
> !image-2022-11-08-09-22-05-188.png!
>  2nd#Improvement:
> problem:
> From the above code,we see for each element in the deltas ,we iterate 
> policies and check if this delta policy exists in the existing policy, we add 
> that to deletePolicies list.
> Solution:
> We need to use Map instead of iterating policies for every element of deltas 
> --> Map<Long,List<RangerPolicy>> policiesIdMap
> Building index map key will be policyId and value will be no of policies 
> associated with the same policy Id
>  



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

Reply via email to