Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-9737

Avoid duplicate tree resolution by using ResultRow.getTree

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.44.0
    • core, security

    Description

      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)

      cc: jhoh for your interest

      Attachments

        Issue Links

          Activity

            People

              angela Angela Schreiber
              angela Angela Schreiber
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: