You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Angela Schreiber (Jira)" <ji...@apache.org> on 2022/03/24 09:03:00 UTC

[jira] [Created] (OAK-9737) Avoid duplicate tree resolution by using ResultRow.getTree

Angela Schreiber created OAK-9737:
-------------------------------------

             Summary: Avoid duplicate tree resolution by using ResultRow.getTree
                 Key: OAK-9737
                 URL: https://issues.apache.org/jira/browse/OAK-9737
             Project: Jackrabbit Oak
          Issue Type: Improvement
          Components: core, security
            Reporter: Angela Schreiber
            Assignee: Angela Schreiber
             Fix For: 1.44.0


hi [~thomasm] as discussed in private i noticed that throughout the oak code base we execute internal queries with the following pattern:

- execute oak query
- retrieve resultrows
- calll {{ResultRow.getPath}} or {{ResultRow.getValue(JCR_PATH)}}
- retrieve the tree associated with the given path

while debugging a problem with [~kpauls] i noticed yesterday that the implementation of {{ResultRow.getPath}} actually retrieves the path from a tree, which to my knowledge was created with the {{Root}} object that executed the query. 

In other words: we retrieve the {{Tree}} objects twice with the same {{ContentSession}} for the same {{Root}} object instead of making use of {{ResultRow.getTree}}.

So far I spotted the following locations where this should be improved:
- IdentifierManager.getTree(String)
- UserQueryManager and ResultRowToAuthorizable
- AccessControlManagerImpl.createPrincipalACL
- AccessControlManagerImpl.getEffectivePolicies
- UserProvider.getAuthorizableByPrincipal

There might also be room for improvement when it comes to 
- IdentifierManager.getReferences (returns iterable of path)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)