jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig <mic...@gmail.com>
Subject [jr3 microkernel] New transient space implementation
Date Thu, 29 Dec 2011 17:19:04 GMT
Hi,

Over at the sandbox [1] I implemented a new (AFAIK) approach for the JCR 
transient space. The gist of it is in the ChangeTree class [2] while 
some more Microkernel specific things are factored out into the 
TransientSpace class [3].

The key idea is to only store changes to the node hierarchy in the 
ChangeTree and to do that in a way which allows reconstructing a list of 
corresponding operations (add, remove, move for nodes and set for 
properties) from that ChangeTree. This differs from other 
implementations where the list of operations is kept *together* with the 
modified hierarchy. Furthermore with the ChangeTree approach no 
untouched nodes need to be kept in memory. Finally the list of 
operations reconstructed from a ChangeTree is minimal. That is, all 
cancelling operations are reduced as much as possible: add followed by 
remove of the same item results in no operations, add followed by move 
of the same node results in the node being added at the target of the 
move, move followed by remove of a node results in the node being 
removed at the source of the move and move followed by another move of a 
node results in a single move from the original source to the eventual 
target. More details are in the class comment of ChangeTree and even 
more details in the implementation ;-)

Michael


[1] http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/

[2] 
http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java?view=markup

[3] 
http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientSpace.java?view=markup

Mime
View raw message