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

star updated RANGER-2879:
-------------------------
    Issue Type: Improvement  (was: Bug)

> Improve performance of incrementally updating policies
> ------------------------------------------------------
>
>                 Key: RANGER-2879
>                 URL: https://issues.apache.org/jira/browse/RANGER-2879
>             Project: Ranger
>          Issue Type: Improvement
>          Components: plugins
>    Affects Versions: 2.0.0
>            Reporter: star
>            Assignee: star
>            Priority: Major
>
> There is large amount of deleting policy operation in incrementally updating 
> mechanism. But policies in RangerPolicyRepository is a List<RangerPolicy>. 
> {code:java}
> //
> private void removePolicy(Long id) {
>     if (LOG.isDebugEnabled()) {
>         LOG.debug("==> RangerPolicyRepository.removePolicy(" + id +")");
>     }
>     Iterator<RangerPolicy> iterator = policies.iterator();
>     while (iterator.hasNext()) {
>         if (id.equals(iterator.next().getId())) {
>             iterator.remove();
>             break;
>         }
>     }
>     policyEvaluatorsMap.remove(id);
>     if (LOG.isDebugEnabled()) {
>         LOG.debug("<== RangerPolicyRepository.removePolicy(" + id +")");
>     }
> }
> {code}
> Replace list with a map structure will improve performance of removePolicy a 
> lot.
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to