[
https://issues.apache.org/jira/browse/OAK-781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13638030#comment-13638030
]
Jukka Zitting commented on OAK-781:
-----------------------------------
I started by updating and clarifying the client-level documentation in
https://github.com/apache/jackrabbit-oak/blob/trunk/doc/nodestate.md. See
especially the notes about {{exists()}} in both NodeState and NodeBuilder.
While updating the documentation, it occurred to me that renaming {{getChild}}
and {{addChild}} to {{getNode}} and {{addNode}} respectively might be a good
idea, as that would make them match the naming of the existing {{setNode}} and
{{removeNode}} methods.
Thinking more generally about the MemoryNodeBuilder, here are some key goals on
which much of the implementation design is (or should be) based on:
* Efficient read-only access. Since we are using NodeBuilders in TreeImpl for
both read-only and read-write cases (doing otherwise would be pretty
complicated), the implementation needs to add as little overhead as possible
when accessing content from the underlying base state when no changes have been
made.
* No unnecessary memory overhead. The required memory or disk space should grow
at most linearly with the amount of modified content. Most notably traversing
through a content hierarchy while making no changes *must not* result in hard
references to all visited nodes. Also weak references should be avoided.
* Extensibility. It should be easy to extend the MemoryNodeBuilder class with
custom mechanism especially for purging pending changes to the underlying
storage, as different backends like KernelNodeStore and SegmentNodeStore may
want to use different algorithms for that. For example the SegmentNodeStore
could more easily purge partial subtrees even while other parts of the tree are
still being modified.
I'll follow up with some more detailed design notes later.
> Clarify / fix effects of MISSING_NODE as base state of NodeBuilder
> ------------------------------------------------------------------
>
> Key: OAK-781
> URL: https://issues.apache.org/jira/browse/OAK-781
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: core
> Reporter: Michael Dürig
> Attachments:
> 0001-OAK-781-Clarify-fix-effects-of-MISSING_NODE-as-base-.patch, OAK-781.patch
>
>
> Having a {{MISSING_NODE}} respectively a node state that returns false for
> its {{exists}} method as a base state of a node builder results in undefined
> behaviour. We need to clarify how to handle such cases for resolving OAK-766.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira