Return-Path: X-Original-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3CE439CCC for ; Wed, 4 Apr 2012 16:25:14 +0000 (UTC) Received: (qmail 84893 invoked by uid 500); 4 Apr 2012 16:25:14 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 84874 invoked by uid 500); 4 Apr 2012 16:25:14 -0000 Mailing-List: contact oak-dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-dev@jackrabbit.apache.org Received: (qmail 84866 invoked by uid 99); 4 Apr 2012 16:25:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Apr 2012 16:25:14 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of stefan.guggisberg@gmail.com designates 209.85.210.170 as permitted sender) Received: from [209.85.210.170] (HELO mail-iy0-f170.google.com) (209.85.210.170) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Apr 2012 16:25:07 +0000 Received: by iaeh11 with SMTP id h11so1256052iae.1 for ; Wed, 04 Apr 2012 09:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=iAIQiUzqOGCvEamQjCwFyzfRzORWj+8Xwed/RcL2Xi8=; b=z4YxKeZfuaCwPYh+SpztZAK65eft9jiLc2A+DANrmIMjLxRilSciMwCvceNIPKFGdH mCpSq2SZGjp3yA1K7v5WK1+VutxD3XKC3j6jrZ37w/Fjv+sV+oib/589QtcwzyJTz2Xx ac2ZZKRir2YNOLO0/OG+k2YxWpTGvtYMIzYDEDF0AdfpZUfC56n8jn4uTe90LMAyHP+D re1rugo4uCWp58lo5lrXoAcDHmgqBPlkuKhnSNv0HsLjHRiWpDBFx9jZ/Q8ZX6xw9rht hrWuktR3O7SYPU2+Iy6FKHInKG355PZNXMMOpuUVAf8myzvys8GYwwHhKW+dI4yJ63w8 yHPg== MIME-Version: 1.0 Received: by 10.50.159.198 with SMTP id xe6mr2566603igb.74.1333556686923; Wed, 04 Apr 2012 09:24:46 -0700 (PDT) Received: by 10.42.137.131 with HTTP; Wed, 4 Apr 2012 09:24:46 -0700 (PDT) In-Reply-To: <20120308113536.77F5C238899C@eris.apache.org> References: <20120308113536.77F5C238899C@eris.apache.org> Date: Wed, 4 Apr 2012 18:24:46 +0200 Message-ID: Subject: Re: svn commit: r1298366 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk: ./ model/ store/ From: Stefan Guggisberg To: oak-dev@jackrabbit.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org i just realized (sorry, a bit late, i know) that this commit breaks some of the optimizations for large child node lists. comparison of nodes had previously been delegated to the Node/ChildNodeEntries implementation by calling Node.diff(Node other). this allowed for specialized handling of large child node collections (see e.g. ChildNodeEnttriesTree.getAdded()). now, with diffing implemented on top of the abstract tree model, those optimizations are unfortunately lost and diffing large collections of child node entries will be highly inefficient and will significantly affect the performance of e.g. MK.getJournal()... cheers stefan On Thu, Mar 8, 2012 at 12:35 PM, wrote: > Author: jukka > Date: Thu Mar =A08 11:35:35 2012 > New Revision: 1298366 > > URL: http://svn.apache.org/viewvc?rev=3D1298366&view=3Drev > Log: > OAK-3: Internal tree model > > Commit proposed patch to implement diffing and related operations on top = of the abstract tree model. > > Added: > =A0 =A0jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/= mk/model/NodeStateDiff.java =A0 (with props) > Modified: > =A0 =A0jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/= mk/MicroKernelImpl.java > =A0 =A0jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/= mk/model/AbstractNode.java > =A0 =A0jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/= mk/model/CommitBuilder.java > =A0 =A0jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/= mk/model/Node.java > =A0 =A0jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/= mk/model/NodeDelta.java > =A0 =A0jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/= mk/model/NodeDiffHandler.java > =A0 =A0jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/= mk/model/TraversingNodeDiffHandler.java > =A0 =A0jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/= mk/store/CopyingGC.java > =A0 =A0jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/= mk/store/DefaultRevisionStore.java > =A0 =A0jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/= mk/store/RevisionProvider.java > =A0 =A0jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/= mk/store/StoredNodeAsState.java > > Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabb= it/mk/MicroKernelImpl.java > URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/= java/org/apache/jackrabbit/mk/MicroKernelImpl.java?rev=3D1298366&r1=3D12983= 65&r2=3D1298366&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= MicroKernelImpl.java (original) > +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= MicroKernelImpl.java Thu Mar =A08 11:35:35 2012 > @@ -20,14 +20,13 @@ import org.apache.jackrabbit.mk.api.Micr > =A0import org.apache.jackrabbit.mk.api.MicroKernelException; > =A0import org.apache.jackrabbit.mk.json.JsopBuilder; > =A0import org.apache.jackrabbit.mk.json.JsopTokenizer; > -import org.apache.jackrabbit.mk.model.ChildNodeEntry; > =A0import org.apache.jackrabbit.mk.model.Commit; > =A0import org.apache.jackrabbit.mk.model.CommitBuilder; > =A0import org.apache.jackrabbit.mk.model.Id; > =A0import org.apache.jackrabbit.mk.model.StoredCommit; > -import org.apache.jackrabbit.mk.model.StoredNode; > =A0import org.apache.jackrabbit.mk.model.TraversingNodeDiffHandler; > =A0import org.apache.jackrabbit.mk.store.NotFoundException; > +import org.apache.jackrabbit.mk.store.RevisionProvider; > =A0import org.apache.jackrabbit.mk.util.CommitGate; > =A0import org.apache.jackrabbit.mk.util.PathUtils; > =A0import org.apache.jackrabbit.mk.util.SimpleLRUCache; > @@ -207,19 +206,20 @@ public class MicroKernelImpl implements > > =A0 =A0 =A0 =A0 try { > =A0 =A0 =A0 =A0 =A0 =A0 final JsopBuilder buff =3D new JsopBuilder(); > + =A0 =A0 =A0 =A0 =A0 =A0final RevisionProvider rp =3D rep.getRevisionSto= re(); > =A0 =A0 =A0 =A0 =A0 =A0 // maps (key: id of target node, value: path/to/t= arget) > =A0 =A0 =A0 =A0 =A0 =A0 // for tracking added/removed nodes; this allows = us > =A0 =A0 =A0 =A0 =A0 =A0 // to detect 'move' operations > =A0 =A0 =A0 =A0 =A0 =A0 final HashMap addedNodes =3D new Hash= Map(); > =A0 =A0 =A0 =A0 =A0 =A0 final HashMap removedNodes =3D new Ha= shMap(); > - =A0 =A0 =A0 =A0 =A0 =A0StoredNode node1, node2; > + =A0 =A0 =A0 =A0 =A0 =A0NodeState node1, node2; > =A0 =A0 =A0 =A0 =A0 =A0 try { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0node1 =3D rep.getNode(fromRevisionId, pa= th); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0node1 =3D rep.getNodeState(fromRevisionI= d, path); > =A0 =A0 =A0 =A0 =A0 =A0 } catch (NotFoundException e) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 node1 =3D null; > =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 =A0 =A0 try { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0node2 =3D rep.getNode(toRevisionId, path= ); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0node2 =3D rep.getNodeState(toRevisionId,= path); > =A0 =A0 =A0 =A0 =A0 =A0 } catch (NotFoundException e) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 node2 =3D null; > =A0 =A0 =A0 =A0 =A0 =A0 } > @@ -227,8 +227,7 @@ public class MicroKernelImpl implements > =A0 =A0 =A0 =A0 =A0 =A0 if (node1 =3D=3D null) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (node2 !=3D null) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 buff.tag('+').key(path).object(); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0toJson(buff, rep.getRevisionStor= e().getNodeState(node2), > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Integer.MAX_VALU= E, 0, -1, false); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0toJson(buff, node2, Integer.MAX_= VALUE, 0, -1, false); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return buff.endObject().newline()= .toString(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 throw new MicroKernelException("p= ath doesn't exist in the specified revisions: " + path); > @@ -239,52 +238,48 @@ public class MicroKernelImpl implements > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return buff.newline().toString(); > =A0 =A0 =A0 =A0 =A0 =A0 } > > - =A0 =A0 =A0 =A0 =A0 =A0TraversingNodeDiffHandler diffHandler =3D new Tr= aversingNodeDiffHandler(rep.getRevisionStore()) { > + =A0 =A0 =A0 =A0 =A0 =A0TraversingNodeDiffHandler diffHandler =3D new Tr= aversingNodeDiffHandler() { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 @Override > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void propAdded(String propName, S= tring value) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void propertyAdded(PropertyState = after) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 buff.tag('+'). > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0key(PathUtils.co= ncat(getCurrentPath(), propName)). > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0encodedValue(val= ue). > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0key(PathUtils.co= ncat(getCurrentPath(), after.getName())). > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0encodedValue(aft= er.getEncodedValue()). > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 newline(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 @Override > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void propChanged(String propName,= String oldValue, String newValue) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void propertyChanged(PropertyStat= e before, PropertyState after) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 buff.tag('^'). > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0key(PathUtils.co= ncat(getCurrentPath(), propName)). > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0encodedValue(new= Value). > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0key(PathUtils.co= ncat(getCurrentPath(), after.getName())). > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0encodedValue(aft= er.getEncodedValue()). > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 newline(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 @Override > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void propDeleted(String propName,= String value) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void propertyDeleted(PropertyStat= e before) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 // since property and node deleti= ons can't be distinguished > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 // using the "- " notation = we're representing > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 // property deletions as "^ :null" > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 buff.tag('^'). > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0key(PathUtils.co= ncat(getCurrentPath(), propName)). > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0key(PathUtils.co= ncat(getCurrentPath(), before.getName())). > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 value(null). > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 newline(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 @Override > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void childNodeAdded(ChildNodeEntr= y added) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0addedNodes.put(added.getId(), Pa= thUtils.concat(getCurrentPath(), added.getName())); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void childNodeAdded(String name, = NodeState after) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0addedNodes.put(rp.getId(after), = PathUtils.concat(getCurrentPath(), name)); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 buff.tag('+'). > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0key(PathUtils.co= ncat(getCurrentPath(), added.getName())).object(); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0try { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0toJson(buff, store.getNo= deState(store.getNode(added.getId())), Integer.MAX_VALUE, 0, -1, false); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} catch (Exception e) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0buff.value("ERROR: faile= d to retrieve node " + added.getId()); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0key(PathUtils.co= ncat(getCurrentPath(), name)).object(); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0toJson(buff, after, Integer.MAX_= VALUE, 0, -1, false); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 buff.endObject().newline(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 @Override > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void childNodeDeleted(ChildNodeEn= try deleted) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0removedNodes.put(deleted.getId()= , PathUtils.concat(getCurrentPath(), deleted.getName())); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void childNodeDeleted(String name= , NodeState before) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0removedNodes.put(rp.getId(before= ), PathUtils.concat(getCurrentPath(), name)); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 buff.tag('-'); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0buff.value(PathUtils.concat(getC= urrentPath(), deleted.getName())); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0buff.value(PathUtils.concat(getC= urrentPath(), name)); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 buff.newline(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 =A0 =A0 }; > @@ -303,58 +298,54 @@ public class MicroKernelImpl implements > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 // TODO refactor code, avoid duplication > > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0diffHandler =3D new TraversingNodeDiffHa= ndler(rep.getRevisionStore()) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0diffHandler =3D new TraversingNodeDiffHa= ndler() { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 @Override > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void propAdded(String pro= pName, String value) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void propertyAdded(Proper= tyState after) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 buff.tag('+'). > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0key(Path= Utils.concat(getCurrentPath(), propName)). > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0encodedV= alue(value). > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0key(Path= Utils.concat(getCurrentPath(), after.getName())). > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0encodedV= alue(after.getEncodedValue()). > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 newline()= ; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 @Override > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void propChanged(String p= ropName, String oldValue, String newValue) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void propertyChanged(Prop= ertyState before, PropertyState after) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 buff.tag('^'). > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0key(Path= Utils.concat(getCurrentPath(), propName)). > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0encodedV= alue(newValue). > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0key(Path= Utils.concat(getCurrentPath(), after.getName())). > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0encodedV= alue(after.getEncodedValue()). > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 newline()= ; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 @Override > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void propDeleted(String p= ropName, String value) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void propertyDeleted(Prop= ertyState before) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 // since property and nod= e deletions can't be distinguished > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 // using the "- " n= otation we're representing > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 // property deletions as = "^ :null" > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 buff.tag('^'). > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0key(Path= Utils.concat(getCurrentPath(), propName)). > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0key(Path= Utils.concat(getCurrentPath(), before.getName())). > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 value(nul= l). > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 newline()= ; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 @Override > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void childNodeAdded(Child= NodeEntry added) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (addedNodes.containsK= ey(added.getId())) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void childNodeAdded(Strin= g name, NodeState after) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (addedNodes.containsK= ey(rp.getId(after))) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 // moved node, wi= ll be processed separately > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 buff.tag('+'). > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0key(Path= Utils.concat(getCurrentPath(), added.getName())).object(); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0try { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0toJson(buff, sto= re.getNodeState(store.getNode(added.getId())), Integer.MAX_VALUE, 0, -1, fa= lse); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} catch (Exception e) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0buff.value("ERRO= R: failed to retrieve node " + added.getId()); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0key(Path= Utils.concat(getCurrentPath(), name)).object(); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0toJson(buff, after, Inte= ger.MAX_VALUE, 0, -1, false); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 buff.endObject().newline(= ); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 @Override > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void childNodeDeleted(Chi= ldNodeEntry deleted) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (addedNodes.containsK= ey(deleted.getId())) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void childNodeDeleted(Str= ing name, NodeState before) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (addedNodes.containsK= ey(rp.getId(before))) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 // moved node, wi= ll be processed separately > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 buff.tag('-'); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0buff.value(PathUtils.con= cat(getCurrentPath(), deleted.getName())); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0buff.value(PathUtils.con= cat(getCurrentPath(), name)); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 buff.newline(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > @@ -596,7 +587,7 @@ public class MicroKernelImpl implements > > =A0 =A0 //-------------------------------------------------------< implem= entation > > > - =A0 =A0void toJson(JsopBuilder builder, NodeState node, int depth, int = offset, int count, boolean inclVirtualProps) throws Exception { > + =A0 =A0void toJson(JsopBuilder builder, NodeState node, int depth, int = offset, int count, boolean inclVirtualProps) { > =A0 =A0 =A0 =A0 for (PropertyState property : node.getProperties()) { > =A0 =A0 =A0 =A0 =A0 =A0 builder.key(property.getName()).encodedValue(prop= erty.getEncodedValue()); > =A0 =A0 =A0 =A0 } > > Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabb= it/mk/model/AbstractNode.java > URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/= java/org/apache/jackrabbit/mk/model/AbstractNode.java?rev=3D1298366&r1=3D12= 98365&r2=3D1298366&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= model/AbstractNode.java (original) > +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= model/AbstractNode.java Thu Mar =A08 11:35:35 2012 > @@ -131,81 +131,6 @@ public abstract class AbstractNode imple > =A0 =A0 =A0 =A0 return node; > =A0 =A0 } > > - =A0 =A0public void diff(Node other, NodeDiffHandler handler) { > - =A0 =A0 =A0 =A0// compare properties > - =A0 =A0 =A0 =A0Map oldProps =3D getProperties(); > - =A0 =A0 =A0 =A0Map newProps =3D other.getProperties(); > - =A0 =A0 =A0 =A0if (!oldProps.equals(newProps)) { > - =A0 =A0 =A0 =A0 =A0 =A0Set set =3D new HashSet(); > - =A0 =A0 =A0 =A0 =A0 =A0set.addAll(oldProps.keySet()); > - =A0 =A0 =A0 =A0 =A0 =A0set.removeAll(newProps.keySet()); > - =A0 =A0 =A0 =A0 =A0 =A0for (String name : set) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0handler.propDeleted(name, oldProps.get(n= ame)); > - =A0 =A0 =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0 =A0 =A0set.clear(); > - =A0 =A0 =A0 =A0 =A0 =A0set.addAll(newProps.keySet()); > - =A0 =A0 =A0 =A0 =A0 =A0set.removeAll(oldProps.keySet()); > - =A0 =A0 =A0 =A0 =A0 =A0for (String name : set) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0handler.propAdded(name, newProps.get(nam= e)); > - =A0 =A0 =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0 =A0 =A0for (Map.Entry entry : oldProps.= entrySet()) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0String val =3D newProps.get(entry.getKey= ()); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (val !=3D null && !entry.getValue().e= quals(val)) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0handler.propChanged(entry.getKey= (), entry.getValue(), val); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0} > - > - =A0 =A0 =A0 =A0// compare child node entries > - > - =A0 =A0 =A0 =A0if (other instanceof AbstractNode) { > - =A0 =A0 =A0 =A0 =A0 =A0ChildNodeEntries otherEntries =3D ((AbstractNode= ) other).childEntries; > - =A0 =A0 =A0 =A0 =A0 =A0for (Iterator it =3D childEntrie= s.getAdded(otherEntries); it.hasNext(); ) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0handler.childNodeAdded(it.next()); > - =A0 =A0 =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0 =A0 =A0for (Iterator it =3D childEntrie= s.getRemoved(otherEntries); it.hasNext(); ) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0handler.childNodeDeleted(it.next()); > - =A0 =A0 =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0 =A0 =A0for (Iterator it =3D childEntrie= s.getModified(otherEntries); it.hasNext(); ) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ChildNodeEntry old =3D it.next(); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ChildNodeEntry modified =3D otherEntries= .get(old.getName()); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0handler.childNodeChanged(old, modified.g= etId()); > - =A0 =A0 =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0 =A0 =A0return; > - =A0 =A0 =A0 =A0} > - > - =A0 =A0 =A0 =A0Map oldEntries =3D new HashMap(getChildNodeCount()); > - =A0 =A0 =A0 =A0for (Iterator it =3D getChildNodeEntries= (0, -1); it.hasNext(); ) { > - =A0 =A0 =A0 =A0 =A0 =A0ChildNodeEntry cne =3D it.next(); > - =A0 =A0 =A0 =A0 =A0 =A0oldEntries.put(cne.getName(), cne); > - =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0Map newEntries =3D new HashMap(other.getChildNodeCount()); > - =A0 =A0 =A0 =A0for (Iterator it =3D other.getChildNodeE= ntries(0, -1); it.hasNext(); ) { > - =A0 =A0 =A0 =A0 =A0 =A0ChildNodeEntry cne =3D it.next(); > - =A0 =A0 =A0 =A0 =A0 =A0newEntries.put(cne.getName(), cne); > - =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0if (!oldEntries.equals(newEntries)) { > - =A0 =A0 =A0 =A0 =A0 =A0Set set =3D new HashSet(); > - =A0 =A0 =A0 =A0 =A0 =A0set.addAll(oldEntries.keySet()); > - =A0 =A0 =A0 =A0 =A0 =A0set.removeAll(newEntries.keySet()); > - =A0 =A0 =A0 =A0 =A0 =A0for (String name : set) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0handler.childNodeDeleted(oldEntries.get(= name)); > - =A0 =A0 =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0 =A0 =A0set.clear(); > - =A0 =A0 =A0 =A0 =A0 =A0set.addAll(newEntries.keySet()); > - =A0 =A0 =A0 =A0 =A0 =A0set.removeAll(oldEntries.keySet()); > - =A0 =A0 =A0 =A0 =A0 =A0for (String name : set) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0handler.childNodeAdded(newEntries.get(na= me)); > - =A0 =A0 =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0 =A0 =A0for (ChildNodeEntry cneOld : oldEntries.values()= ) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ChildNodeEntry cneNew =3D newEntries.get= (cneOld.getName()); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (cneNew !=3D null && !cneNew.getId().= equals(cneOld.getId())) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0handler.childNodeChanged(cneOld,= cneNew.getId()); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0} > - =A0 =A0} > - > =A0 =A0 public void serialize(Binding binding) throws Exception { > =A0 =A0 =A0 =A0 final Iterator> iter =3D proper= ties.entrySet().iterator(); > =A0 =A0 =A0 =A0 binding.writeMap(":props", properties.size(), > @@ -227,4 +152,4 @@ public abstract class AbstractNode imple > =A0 =A0 =A0 =A0 binding.write(":inlined", childEntries.inlined() ? 1 : 0)= ; > =A0 =A0 =A0 =A0 childEntries.serialize(binding); > =A0 =A0 } > -} > \ No newline at end of file > +} > > Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabb= it/mk/model/CommitBuilder.java > URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/= java/org/apache/jackrabbit/mk/model/CommitBuilder.java?rev=3D1298366&r1=3D1= 298365&r2=3D1298366&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= model/CommitBuilder.java (original) > +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= model/CommitBuilder.java Thu Mar =A08 11:35:35 2012 > @@ -336,8 +336,10 @@ public class CommitBuilder { > =A0 =A0 } > > =A0 =A0 void mergeNode(StoredNode baseNode, StoredNode ourNode, StoredNod= e theirNode, String path) throws Exception { > - =A0 =A0 =A0 =A0NodeDelta theirChanges =3D new NodeDelta(baseNode, their= Node); > - =A0 =A0 =A0 =A0NodeDelta ourChanges =3D new NodeDelta(baseNode, ourNode= ); > + =A0 =A0 =A0 =A0NodeDelta theirChanges =3D new NodeDelta( > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0store, store.getNodeState(baseNode), sto= re.getNodeState(theirNode)); > + =A0 =A0 =A0 =A0NodeDelta ourChanges =3D new NodeDelta( > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0store, store.getNodeState(baseNode), sto= re.getNodeState(ourNode)); > > =A0 =A0 =A0 =A0 // merge non-conflicting changes > =A0 =A0 =A0 =A0 MutableNode mergedNode =3D new MutableNode(theirNode, sto= re); > > Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabb= it/mk/model/Node.java > URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/= java/org/apache/jackrabbit/mk/model/Node.java?rev=3D1298366&r1=3D1298365&r2= =3D1298366&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= model/Node.java (original) > +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= model/Node.java Thu Mar =A08 11:35:35 2012 > @@ -39,7 +39,5 @@ public interface Node { > =A0 =A0 Iterator getChildNodes(int offset, int count) throws E= xception; > =A0 =A0 Node getNode(String relPath) throws NotFoundException, Exception; > > - =A0 =A0void diff(Node other, NodeDiffHandler handler); > - > =A0 =A0 void serialize(Binding binding) throws Exception; > =A0} > > Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabb= it/mk/model/NodeDelta.java > URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/= java/org/apache/jackrabbit/mk/model/NodeDelta.java?rev=3D1298366&r1=3D12983= 65&r2=3D1298366&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= model/NodeDelta.java (original) > +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= model/NodeDelta.java Thu Mar =A08 11:35:35 2012 > @@ -21,10 +21,14 @@ import java.util.HashMap; > =A0import java.util.List; > =A0import java.util.Map; > > +import org.apache.jackrabbit.mk.store.RevisionProvider; > +import org.apache.jackrabbit.oak.model.NodeState; > +import org.apache.jackrabbit.oak.model.PropertyState; > + > =A0/** > =A0* > =A0*/ > -public class NodeDelta implements NodeDiffHandler { > +public class NodeDelta { > > =A0 =A0 public static enum ConflictType { > =A0 =A0 =A0 =A0 /** > @@ -47,8 +51,9 @@ public class NodeDelta implements NodeDi > =A0 =A0 =A0 =A0 REMOVED_DIRTY_NODE_CONFLICT > =A0 =A0 } > > - =A0 =A0final StoredNode node1; > - =A0 =A0final StoredNode node2; > + =A0 =A0private final RevisionProvider provider; > + > + =A0 =A0private final NodeState node1; > > =A0 =A0 Map addedProperties =3D new HashMap(); > =A0 =A0 Map removedProperties =3D new HashMap(); > @@ -58,11 +63,11 @@ public class NodeDelta implements NodeDi > =A0 =A0 Map removedChildNodes =3D new HashMap(); > =A0 =A0 Map changedChildNodes =3D new HashMap(); > > - =A0 =A0public NodeDelta(StoredNode node1, StoredNode node2) throws Exce= ption { > + =A0 =A0public NodeDelta( > + =A0 =A0 =A0 =A0 =A0 =A0RevisionProvider provider, NodeState node1, Node= State node2) { > + =A0 =A0 =A0 =A0this.provider =3D provider; > =A0 =A0 =A0 =A0 this.node1 =3D node1; > - =A0 =A0 =A0 =A0this.node2 =3D node2; > - > - =A0 =A0 =A0 =A0node1.diff(node2, this); > + =A0 =A0 =A0 =A0new DiffHandler().compare(node1, node2); > =A0 =A0 } > > =A0 =A0 public Map getAddedProperties() { > @@ -95,7 +100,7 @@ public class NodeDelta implements NodeDi > > =A0 =A0 public List listConflicts(NodeDelta other) { > =A0 =A0 =A0 =A0 // assume that both delta's were built using the *same* b= ase node revision > - =A0 =A0 =A0 =A0if (!node1.getId().equals(other.node1.getId())) { > + =A0 =A0 =A0 =A0if (!node1.equals(other.node1)) { > =A0 =A0 =A0 =A0 =A0 =A0 throw new IllegalArgumentException("other and thi= s NodeDelta object are expected to share common node1 instance"); > =A0 =A0 =A0 =A0 } > > @@ -168,33 +173,42 @@ public class NodeDelta implements NodeDi > =A0 =A0 =A0 =A0 return conflicts; > =A0 =A0 } > > - =A0 =A0//------------------------------------------------------< NodeDi= ffHandler > > + =A0 =A0//--------------------------------------------------------< inne= r classes > > > - =A0 =A0public void propAdded(String propName, String value) { > - =A0 =A0 =A0 =A0addedProperties.put(propName, value); > - =A0 =A0} > + =A0 =A0private class DiffHandler extends NodeStateDiff { > > - =A0 =A0public void propChanged(String propName, String oldValue, String= newValue) { > - =A0 =A0 =A0 =A0changedProperties.put(propName, newValue); > - =A0 =A0} > + =A0 =A0 =A0 =A0@Override > + =A0 =A0 =A0 =A0public void propertyAdded(PropertyState after) { > + =A0 =A0 =A0 =A0 =A0 =A0addedProperties.put(after.getName(), after.getEn= codedValue()); > + =A0 =A0 =A0 =A0} > > - =A0 =A0public void propDeleted(String propName, String value) { > - =A0 =A0 =A0 =A0removedProperties.put(propName, value); > - =A0 =A0} > + =A0 =A0 =A0 =A0@Override > + =A0 =A0 =A0 =A0public void propertyChanged(PropertyState before, Proper= tyState after) { > + =A0 =A0 =A0 =A0 =A0 =A0changedProperties.put(after.getName(), after.get= EncodedValue()); > + =A0 =A0 =A0 =A0} > > - =A0 =A0public void childNodeAdded(ChildNodeEntry added) { > - =A0 =A0 =A0 =A0addedChildNodes.put(added.getName(), added.getId()); > - =A0 =A0} > + =A0 =A0 =A0 =A0@Override > + =A0 =A0 =A0 =A0public void propertyDeleted(PropertyState before) { > + =A0 =A0 =A0 =A0 =A0 =A0removedProperties.put(before.getName(), before.g= etEncodedValue()); > + =A0 =A0 =A0 =A0} > > - =A0 =A0public void childNodeDeleted(ChildNodeEntry deleted) { > - =A0 =A0 =A0 =A0removedChildNodes.put(deleted.getName(), deleted.getId()= ); > - =A0 =A0} > + =A0 =A0 =A0 =A0@Override > + =A0 =A0 =A0 =A0public void childNodeAdded(String name, NodeState after)= { > + =A0 =A0 =A0 =A0 =A0 =A0addedChildNodes.put(name, provider.getId(after))= ; > + =A0 =A0 =A0 =A0} > > - =A0 =A0public void childNodeChanged(ChildNodeEntry changed, Id newId) { > - =A0 =A0 =A0 =A0changedChildNodes.put(changed.getName(), newId); > - =A0 =A0} > + =A0 =A0 =A0 =A0@Override > + =A0 =A0 =A0 =A0public void childNodeChanged( > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0String name, NodeState before, NodeState= after) { > + =A0 =A0 =A0 =A0 =A0 =A0changedChildNodes.put(name, provider.getId(after= )); > + =A0 =A0 =A0 =A0} > > - =A0 =A0//--------------------------------------------------------< inne= r classes > > + =A0 =A0 =A0 =A0@Override > + =A0 =A0 =A0 =A0public void childNodeDeleted(String name, NodeState befo= re) { > + =A0 =A0 =A0 =A0 =A0 =A0removedChildNodes.put(name, provider.getId(befor= e)); > + =A0 =A0 =A0 =A0} > + > + =A0 =A0} > > =A0 =A0 public static class Conflict { > > > Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabb= it/mk/model/NodeDiffHandler.java > URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/= java/org/apache/jackrabbit/mk/model/NodeDiffHandler.java?rev=3D1298366&r1= =3D1298365&r2=3D1298366&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= model/NodeDiffHandler.java (original) > +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= model/NodeDiffHandler.java Thu Mar =A08 11:35:35 2012 > @@ -1,35 +0,0 @@ > -/* > - * Licensed to the Apache Software Foundation (ASF) under one or more > - * contributor license agreements. =A0See the NOTICE file distributed wi= th > - * this work for additional information regarding copyright ownership. > - * The ASF licenses this file to You under the Apache License, Version 2= .0 > - * (the "License"); you may not use this file except in compliance with > - * the License. =A0You may obtain a copy of the License at > - * > - * =A0 =A0 http://www.apache.org/licenses/LICENSE-2.0 > - * > - * Unless required by applicable law or agreed to in writing, software > - * distributed under the License is distributed on an "AS IS" BASIS, > - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impli= ed. > - * See the License for the specific language governing permissions and > - * limitations under the License. > - */ > -package org.apache.jackrabbit.mk.model; > - > -/** > - * > - */ > -public interface NodeDiffHandler { > - > - =A0 =A0void propAdded(String propName, String value); > - > - =A0 =A0void propChanged(String propName, String oldValue, String newVal= ue); > - > - =A0 =A0void propDeleted(String propName, String value); > - > - =A0 =A0void childNodeAdded(ChildNodeEntry added); > - > - =A0 =A0void childNodeDeleted(ChildNodeEntry deleted); > - > - =A0 =A0void childNodeChanged(ChildNodeEntry changed, Id newId); > -} > > Added: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/= mk/model/NodeStateDiff.java > URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/= java/org/apache/jackrabbit/mk/model/NodeStateDiff.java?rev=3D1298366&view= =3Dauto > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= model/NodeStateDiff.java (added) > +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= model/NodeStateDiff.java Thu Mar =A08 11:35:35 2012 > @@ -0,0 +1,167 @@ > +/* > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. =A0See the NOTICE file distributed wi= th > + * this work for additional information regarding copyright ownership. > + * The ASF licenses this file to You under the Apache License, Version 2= .0 > + * (the "License"); you may not use this file except in compliance with > + * the License. =A0You may obtain a copy of the License at > + * > + * =A0 =A0 http://www.apache.org/licenses/LICENSE-2.0 > + * > + * Unless required by applicable law or agreed to in writing, software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impli= ed. > + * See the License for the specific language governing permissions and > + * limitations under the License. > + */ > +package org.apache.jackrabbit.mk.model; > + > +import java.util.HashSet; > +import java.util.Set; > + > +import org.apache.jackrabbit.oak.model.ChildNodeEntry; > +import org.apache.jackrabbit.oak.model.NodeState; > +import org.apache.jackrabbit.oak.model.PropertyState; > + > +/** > + * Utility base class for comparing two {@link NodeState} instances. The > + * {@link #compare(NodeState, NodeState)} method will go through all > + * properties and child nodes of the two states, calling the relevant > + * added, changed or deleted methods where appropriate. Differences in > + * the ordering of properties or child nodes do not affect the compariso= n. > + */ > +public class NodeStateDiff { > + > + =A0 =A0/** > + =A0 =A0 * Called by {@link #compare(NodeState, NodeState)} for all adde= d > + =A0 =A0 * properties. The default implementation does nothing. > + =A0 =A0 * > + =A0 =A0 * @param after property state after the change > + =A0 =A0 */ > + =A0 =A0public void propertyAdded(PropertyState after) { > + =A0 =A0} > + > + =A0 =A0/** > + =A0 =A0 * Called by {@link #compare(NodeState, NodeState)} for all chan= ged > + =A0 =A0 * properties. The names of the given two property states are gu= aranteed > + =A0 =A0 * to be the same. The default implementation does nothing. > + =A0 =A0 * > + =A0 =A0 * @param before property state before the change > + =A0 =A0 * @param after property state after the change > + =A0 =A0 */ > + =A0 =A0public void propertyChanged(PropertyState before, PropertyState = after) { > + =A0 =A0} > + > + =A0 =A0/** > + =A0 =A0 * Called by {@link #compare(NodeState, NodeState)} for all dele= ted > + =A0 =A0 * properties. The default implementation does nothing. > + =A0 =A0 * > + =A0 =A0 * @param before property state before the change > + =A0 =A0 */ > + =A0 =A0public void propertyDeleted(PropertyState before) { > + =A0 =A0} > + > + =A0 =A0/** > + =A0 =A0 * Called by {@link #compare(NodeState, NodeState)} for all adde= d > + =A0 =A0 * child nodes. The default implementation does nothing. > + =A0 =A0 * > + =A0 =A0 * @param name name of the added child node > + =A0 =A0 * @param after child node state after the change > + =A0 =A0 */ > + =A0 =A0public void childNodeAdded(String name, NodeState after) { > + =A0 =A0} > + > + =A0 =A0/** > + =A0 =A0 * Called by {@link #compare(NodeState, NodeState)} for all chan= ged > + =A0 =A0 * child nodes. The default implementation does nothing. > + =A0 =A0 * > + =A0 =A0 * @param name name of the changed child node > + =A0 =A0 * @param before child node state before the change > + =A0 =A0 * @param after child node state after the change > + =A0 =A0 */ > + =A0 =A0public void childNodeChanged(String name, NodeState before, Node= State after) { > + =A0 =A0} > + > + =A0 =A0/** > + =A0 =A0 * Called by {@link #compare(NodeState, NodeState)} for all dele= ted > + =A0 =A0 * child nodes. The default implementation does nothing. > + =A0 =A0 * > + =A0 =A0 * @param name name of the deleted child node > + =A0 =A0 * @param before child node state before the change > + =A0 =A0 */ > + =A0 =A0public void childNodeDeleted(String name, NodeState before) { > + =A0 =A0} > + > + =A0 =A0/** > + =A0 =A0 * Compares the given two node states. Any found differences are > + =A0 =A0 * reported by calling the relevant added, changed or deleted me= thods. > + =A0 =A0 * > + =A0 =A0 * @param before node state before changes > + =A0 =A0 * @param after node state after changes > + =A0 =A0 */ > + =A0 =A0public void compare(NodeState before, NodeState after) { > + =A0 =A0 =A0 =A0compareProperties(before, after); > + =A0 =A0 =A0 =A0compareChildNodes(before, after); > + =A0 =A0} > + > + =A0 =A0/** > + =A0 =A0 * Compares the properties of the given two node states. > + =A0 =A0 * > + =A0 =A0 * @param before node state before changes > + =A0 =A0 * @param after node state after changes > + =A0 =A0 */ > + =A0 =A0private void compareProperties(NodeState before, NodeState after= ) { > + =A0 =A0 =A0 =A0Set beforeProperties =3D new HashSet(); > + > + =A0 =A0 =A0 =A0for (PropertyState beforeProperty : before.getProperties= ()) { > + =A0 =A0 =A0 =A0 =A0 =A0String name =3D beforeProperty.getName(); > + =A0 =A0 =A0 =A0 =A0 =A0PropertyState afterProperty =3D after.getPropert= y(name); > + =A0 =A0 =A0 =A0 =A0 =A0if (afterProperty =3D=3D null) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0propertyDeleted(beforeProperty); > + =A0 =A0 =A0 =A0 =A0 =A0} else { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0beforeProperties.add(name); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!beforeProperty.equals(afterProperty= )) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0propertyChanged(beforeProperty, = afterProperty); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > + =A0 =A0 =A0 =A0 =A0 =A0} > + =A0 =A0 =A0 =A0} > + > + =A0 =A0 =A0 =A0for (PropertyState afterProperty : after.getProperties()= ) { > + =A0 =A0 =A0 =A0 =A0 =A0if (!beforeProperties.contains(afterProperty.get= Name())) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0propertyAdded(afterProperty); > + =A0 =A0 =A0 =A0 =A0 =A0} > + =A0 =A0 =A0 =A0} > + =A0 =A0} > + > + =A0 =A0/** > + =A0 =A0 * Compares the child nodes of the given two node states. > + =A0 =A0 * > + =A0 =A0 * @param before node state before changes > + =A0 =A0 * @param after node state after changes > + =A0 =A0 */ > + =A0 =A0private void compareChildNodes(NodeState before, NodeState after= ) { > + =A0 =A0 =A0 =A0Set beforeChildNodes =3D new HashSet(); > + > + =A0 =A0 =A0 =A0for (ChildNodeEntry beforeCNE : before.getChildNodeEntri= es(0, -1)) { > + =A0 =A0 =A0 =A0 =A0 =A0String name =3D beforeCNE.getName(); > + =A0 =A0 =A0 =A0 =A0 =A0NodeState beforeChild =3D beforeCNE.getNode(); > + =A0 =A0 =A0 =A0 =A0 =A0NodeState afterChild =3D after.getChildNode(name= ); > + =A0 =A0 =A0 =A0 =A0 =A0if (afterChild =3D=3D null) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0childNodeDeleted(name, beforeChild); > + =A0 =A0 =A0 =A0 =A0 =A0} else { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0beforeChildNodes.add(name); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!beforeChild.equals(afterChild)) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0childNodeChanged(name, beforeChi= ld, afterChild); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > + =A0 =A0 =A0 =A0 =A0 =A0} > + =A0 =A0 =A0 =A0} > + > + =A0 =A0 =A0 =A0for (ChildNodeEntry afterChild : after.getChildNodeEntri= es(0, -1)) { > + =A0 =A0 =A0 =A0 =A0 =A0String name =3D afterChild.getName(); > + =A0 =A0 =A0 =A0 =A0 =A0if (!beforeChildNodes.contains(name)) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0childNodeAdded(name, afterChild.getNode(= )); > + =A0 =A0 =A0 =A0 =A0 =A0} > + =A0 =A0 =A0 =A0} > + =A0 =A0} > + > +} > > Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackra= bbit/mk/model/NodeStateDiff.java > -------------------------------------------------------------------------= ----- > =A0 =A0svn:eol-style =3D native > > Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabb= it/mk/model/TraversingNodeDiffHandler.java > URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/= java/org/apache/jackrabbit/mk/model/TraversingNodeDiffHandler.java?rev=3D12= 98366&r1=3D1298365&r2=3D1298366&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= model/TraversingNodeDiffHandler.java (original) > +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= model/TraversingNodeDiffHandler.java Thu Mar =A08 11:35:35 2012 > @@ -16,68 +16,38 @@ > =A0*/ > =A0package org.apache.jackrabbit.mk.model; > > -import org.apache.jackrabbit.mk.store.RevisionProvider; > =A0import org.apache.jackrabbit.mk.util.PathUtils; > +import org.apache.jackrabbit.oak.model.NodeState; > > =A0import java.util.Stack; > > =A0/** > =A0* > =A0*/ > -public abstract class TraversingNodeDiffHandler implements NodeDiffHandl= er { > +public abstract class TraversingNodeDiffHandler extends NodeStateDiff { > > - =A0 =A0protected final RevisionProvider store; > - =A0 =A0protected Stack paths =3D new Stack(); > - > - =A0 =A0public TraversingNodeDiffHandler(RevisionProvider store) { > - =A0 =A0 =A0 =A0this.store =3D store; > - =A0 =A0} > + =A0 =A0protected Stack paths =3D new Stack(); > > - =A0 =A0public void start(Node node1, Node node2) throws Exception { > - =A0 =A0 =A0 =A0start(node1, node2, "/"); > + =A0 =A0public void start(NodeState before, NodeState after) { > + =A0 =A0 =A0 =A0start(before, after, "/"); > =A0 =A0 } > > - =A0 =A0public void start(Node node1, Node node2, String path) throws Ex= ception { > + =A0 =A0public void start(NodeState before, NodeState after, String path= ) { > =A0 =A0 =A0 =A0 paths.clear(); > =A0 =A0 =A0 =A0 paths.push(path); > - =A0 =A0 =A0 =A0try { > - =A0 =A0 =A0 =A0 =A0 =A0node1.diff(node2, this); > - =A0 =A0 =A0 =A0} catch (RuntimeException e) { > - =A0 =A0 =A0 =A0 =A0 =A0Throwable root =3D e.getCause(); > - =A0 =A0 =A0 =A0 =A0 =A0if (root !=3D null && root instanceof Exception)= { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0throw (Exception) root; > - =A0 =A0 =A0 =A0 =A0 =A0} else { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0throw e; > - =A0 =A0 =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0} > - =A0 =A0} > - > - =A0 =A0protected String getCurrentPath() { > - =A0 =A0 =A0 =A0return (String) paths.peek(); > - =A0 =A0} > - > - =A0 =A0public void propAdded(String propName, String value) { > - =A0 =A0} > - > - =A0 =A0public void propChanged(String propName, String oldValue, String= newValue) { > + =A0 =A0 =A0 =A0compare(before, after); > =A0 =A0 } > > - =A0 =A0public void propDeleted(String propName, String value) { > - =A0 =A0} > - > - =A0 =A0public void childNodeAdded(ChildNodeEntry added) { > - =A0 =A0} > - > - =A0 =A0public void childNodeDeleted(ChildNodeEntry deleted) { > + =A0 =A0protected String getCurrentPath() { > + =A0 =A0 =A0 =A0return paths.peek(); > =A0 =A0 } > > - =A0 =A0public void childNodeChanged(ChildNodeEntry changed, Id newId) { > - =A0 =A0 =A0 =A0paths.push(PathUtils.concat(getCurrentPath(), changed.ge= tName())); > - =A0 =A0 =A0 =A0try { > - =A0 =A0 =A0 =A0 =A0 =A0store.getNode(changed.getId()).diff(store.getNod= e(newId), this); > - =A0 =A0 =A0 =A0} catch (Exception e) { > - =A0 =A0 =A0 =A0 =A0 =A0throw new RuntimeException(e); > - =A0 =A0 =A0 =A0} > + =A0 =A0@Override > + =A0 =A0public void childNodeChanged( > + =A0 =A0 =A0 =A0 =A0 =A0String name, NodeState before, NodeState after) = { > + =A0 =A0 =A0 =A0paths.push(PathUtils.concat(getCurrentPath(), name)); > + =A0 =A0 =A0 =A0compare(before, after); > =A0 =A0 =A0 =A0 paths.pop(); > =A0 =A0 } > + > =A0} > > Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabb= it/mk/store/CopyingGC.java > URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/= java/org/apache/jackrabbit/mk/store/CopyingGC.java?rev=3D1298366&r1=3D12983= 65&r2=3D1298366&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= store/CopyingGC.java (original) > +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= store/CopyingGC.java Thu Mar =A08 11:35:35 2012 > @@ -175,6 +175,10 @@ public class CopyingGC implements Revisi > =A0 =A0 =A0 =A0 return new StoredNodeAsState(node, this); > =A0 =A0 } > > + =A0 =A0public Id getId(NodeState node) { > + =A0 =A0 =A0 =A0return ((StoredNodeAsState) node).getId(); > + =A0 =A0} > + > =A0 =A0 public StoredNode getNode(Id id) throws NotFoundException, Except= ion { > =A0 =A0 =A0 =A0 if (running) { > =A0 =A0 =A0 =A0 =A0 =A0 try { > > Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabb= it/mk/store/DefaultRevisionStore.java > URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/= java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java?rev=3D1298366= &r1=3D1298365&r2=3D1298366&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= store/DefaultRevisionStore.java (original) > +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= store/DefaultRevisionStore.java Thu Mar =A08 11:35:35 2012 > @@ -247,6 +247,10 @@ public class DefaultRevisionStore implem > =A0 =A0 =A0 =A0 return new StoredNodeAsState(node, this); > =A0 =A0 } > > + =A0 =A0public Id getId(NodeState node) { > + =A0 =A0 =A0 =A0return ((StoredNodeAsState) node).getId(); > + =A0 =A0} > + > =A0 =A0 public StoredNode getNode(Id id) throws NotFoundException, Except= ion { > =A0 =A0 =A0 =A0 verifyInitialized(); > > > Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabb= it/mk/store/RevisionProvider.java > URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/= java/org/apache/jackrabbit/mk/store/RevisionProvider.java?rev=3D1298366&r1= =3D1298365&r2=3D1298366&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= store/RevisionProvider.java (original) > +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= store/RevisionProvider.java Thu Mar =A08 11:35:35 2012 > @@ -36,6 +36,14 @@ public interface RevisionProvider { > =A0 =A0 =A0*/ > =A0 =A0 NodeState getNodeState(StoredNode node); > > + =A0 =A0/** > + =A0 =A0 * Adapts the given {@link NodeState} to the corresponding ident= ifier. > + =A0 =A0 * > + =A0 =A0 * @param node node state > + =A0 =A0 * @return node identifier > + =A0 =A0 */ > + =A0 =A0Id getId(NodeState node); > + > =A0 =A0 StoredNode getNode(Id id) throws NotFoundException, Exception; > =A0 =A0 StoredCommit getCommit(String id) throws NotFoundException, Excep= tion; > =A0 =A0 ChildNodeEntriesMap getCNEMap(Id id) throws NotFoundException, Ex= ception; > > Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabb= it/mk/store/StoredNodeAsState.java > URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/= java/org/apache/jackrabbit/mk/store/StoredNodeAsState.java?rev=3D1298366&r1= =3D1298365&r2=3D1298366&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= store/StoredNodeAsState.java (original) > +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/= store/StoredNodeAsState.java Thu Mar =A08 11:35:35 2012 > @@ -20,6 +20,7 @@ import java.util.Collections; > =A0import java.util.Iterator; > =A0import java.util.Map; > > +import org.apache.jackrabbit.mk.model.Id; > =A0import org.apache.jackrabbit.mk.model.StoredNode; > =A0import org.apache.jackrabbit.oak.model.AbstractChildNodeEntry; > =A0import org.apache.jackrabbit.oak.model.AbstractNodeState; > @@ -39,6 +40,10 @@ class StoredNodeAsState extends Abstract > =A0 =A0 =A0 =A0 this.provider =3D provider; > =A0 =A0 } > > + =A0 =A0Id getId() { > + =A0 =A0 =A0 =A0return node.getId(); > + =A0 =A0} > + > =A0 =A0 private static class SimplePropertyState extends AbstractProperty= State { > > =A0 =A0 =A0 =A0 private final String name; > >