Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.0.0
-
None
-
None
Description
There is large amount of deleting policy operation in incrementally updating mechanism. But policies in RangerPolicyRepository is a List<RangerPolicy>.
// 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 +")"); } }
Replace list with a map structure will improve performance of removePolicy a lot.
Attachments
Issue Links
- is related to
-
RANGER-2658 Support million policies in ranger.
- Open