jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Guggisberg <sgugg...@adobe.com>
Subject Re: Staged vs. Stored node
Date Wed, 17 Oct 2012 12:03:33 GMT
hi mete

i'm copying the oak-dev list since this might be of interest to others.
comments follow inline...

On Tue, Oct 16, 2012 at 8:30 PM, Mete Atamel <matamel@adobe.com> wrote:
> Hi Stefan,
> One thing that I've been wanting to ask you is the distinction between
> StagedNode vs. StoredNode. I see in StagedNodeTree, you use both but I
> don't understand when one is used vs. other.

the naming (staged nodes) is git-inspired. in git changes need to be 'staged'
('git add') before they can be committed.

StagedNode represents a mutable node instance whereas a StoredNode is
immutable. StagedNodeTree is used to build and collect changes to the
node tree.


+/foo : { baz : "blah" }

results in 2 StagedNode instances:

1. new root node "/" with a new child node entry "baz" pointing to 2.
2. new child node "/baz"

those changes can then be committed by persisting all StagedNode
instances recursively (bottom up), resulting in a new revision pointing
to the new root node.

please note that is specific to the default mk's versioning model
(git-like contenthash-based identifiers).


> In MongoMK, we have one
> notion of Node and that seems to work fine but I'm curious why you made
> staged vs. stored node distinction in your implementation and see if it's
> something we need to think about as well.
> Thanks!
> Mete
View raw message