Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
JCR Resource 3.0.22
-
None
Description
Currently JcrResourceProvider.getParent is using JcrItemResourceFactory.getItemOrNull(String path), which eventually is using JCR session to retrieve parent node using absolute path.
I propose using javax.jcr.Item.getParent() instead.
Reasoning wold be to utilise potential improvements in JCR implementation that would for a given node retrieve the whole subtree. That can be configured for example by using particular node type or node path.
root | a / \ b c
If node 'a' in picture above, is matching desired configuration, then code below would return the whole subtree.
Node a = jcrSession.getNode("a");
That further means retrieved subtree can be traversed in memory, without the need to communicate with the JCR repository storage.
(!)That is particularly important when remote (cloud) storage is used for repository in JCR implementation, and tree traversal can be done without doing additional network roundtrips.
//JCR tree traversal happens in memory Node b = a.getNode("b"); Node c = a.getNode("c");
Also going from child to parent, is resolved in memory as well (proposal relates to this fact)
//JCR tree traversal happens in memory assert b.getParent() == c.getParent();
Jackrabbit Oak, for document node store is supporting node bundling for configured node type
http://jackrabbit.apache.org/oak/docs/nodestore/document/node-bundling.html
Currently I am also doing some experiments to support node bundling/aggregation for arbitrary node store (NodeDelegateFullyLoaded, FullyLoadedTree).
Attachments
Issue Links
- is blocked by
-
OAK-9613 Define API to retrieve parent or null for a given Item
- Closed
- is related to
-
SLING-11311 Improve org-apache-sling-jcr-resource
- Closed
- relates to
-
SLING-8761 Resource.getParent() should not generate silent AccessDeniedException
- Resolved
-
JCR-3870 Export SessionImpl#getItemOrNull in JackrabbitSession
- Closed
-
SLING-4585 Performance: Use JackrabbitSession#getItemOrNull to speed up JcrResourceProvider#createResource
- Closed