jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Miroslav Smiljanic (Jira)" <j...@apache.org>
Subject [jira] [Closed] (OAK-9332) Document best practices and anti-patterns in repository tree traversal
Date Thu, 03 Jun 2021 14:54:06 GMT

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

Miroslav Smiljanic closed OAK-9332.
-----------------------------------

> Document best practices and anti-patterns in repository tree traversal  
> ------------------------------------------------------------------------
>
>                 Key: OAK-9332
>                 URL: https://issues.apache.org/jira/browse/OAK-9332
>             Project: Jackrabbit Oak
>          Issue Type: Documentation
>          Components: doc
>            Reporter: Miroslav Smiljanic
>            Assignee: Miroslav Smiljanic
>            Priority: Major
>             Fix For: 1.40.0
>
>
> When using JCR API, there is more than one way to perform tree/path traversal:
> {code:java}
> Node c = session.getNode("/a/b/c");
> Node d = null;
> //get child node
> d = session.getNode("/a/b/c/d");
> d = c.getNode("d");
> // get parent node
> c = d.getParent();
> c = session.getNode("/a/b/c");
> {code}
> To traverse a path using Node API with  performs better compared to Session API. 
> {noformat}
> > java -jar target/oak-benchmarks-*-SNAPSHOT.jar benchmark  GetParentNodeWithNodeAPI
 GetParentNodeWithSessionAPI  Oak-Segment-Tar
> Apache Jackrabbit Oak 1.37-SNAPSHOT
> # GetParentNodeWithNodeAPI         C     min     10%     50%     90%     max     N  
    mean 
> Oak-Segment-Tar                    1       2       2       2       3      5   25891 
     2
> # GetParentNodeWithSessionAP       C     min     10%     50%     90%     max     N  
    mean 
> Oak-Segment-Tar                    1      26      27      29      32     40    2069 
    29{noformat}
> Example where Session API is used: https://issues.apache.org/jira/browse/SLING-10011
> Considering Oak implementation details (tree repository structure, ACL evaluation, ...)
the best practice for path traversal should be explicitly documented.



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

Mime
View raw message