jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1310234 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/ oak-mk/src/main/java/org/apache/jackrabbit/mk/core/ oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ oak-mk/src/main/java/org/apache/jackrabbi...
Date Fri, 06 Apr 2012 08:44:59 GMT
Author: jukka
Date: Fri Apr  6 08:44:58 2012
New Revision: 1310234

URL: http://svn.apache.org/viewvc?rev=1310234&view=rev
Log:
OAK-46: Efficient diffing of large child node lists

Make the comparison operation a part of the tree interfaces instead of a concrete class

Added:
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/AbstractRevisionStore.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeDelta.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStateDiff.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStore.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/TraversingNodeDiffHandler.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/CopyingGC.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/RevisionProvider.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java?rev=1310234&r1=1310233&r2=1310234&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java
Fri Apr  6 08:44:58 2012
@@ -20,6 +20,7 @@ package org.apache.jackrabbit.oak.kernel
 
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.model.NodeState;
+import org.apache.jackrabbit.mk.model.NodeStateDiff;
 import org.apache.jackrabbit.mk.model.NodeStateEditor;
 import org.apache.jackrabbit.mk.model.NodeStore;
 
@@ -56,4 +57,9 @@ public class KernelNodeStore implements 
         return ((KernelNodeStateEditor) branch).mergeInto(kernel, (KernelNodeState) target);
     }
 
+    @Override
+    public void compare(NodeState before, NodeState after, NodeStateDiff diff) {
+        throw new UnsupportedOperationException(); // TODO
+    }
+
 }

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java?rev=1310234&r1=1310233&r2=1310234&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
Fri Apr  6 08:44:58 2012
@@ -271,7 +271,7 @@ public class MicroKernelImpl implements 
                 return buff.newline().toString();
             }
 
-            TraversingNodeDiffHandler diffHandler = new TraversingNodeDiffHandler() {
+            TraversingNodeDiffHandler diffHandler = new TraversingNodeDiffHandler(rp) {
                 @Override
                 public void propertyAdded(PropertyState after) {
                     buff.tag('+').
@@ -331,7 +331,7 @@ public class MicroKernelImpl implements 
 
                 // TODO refactor code, avoid duplication
 
-                diffHandler = new TraversingNodeDiffHandler() {
+                diffHandler = new TraversingNodeDiffHandler(rp) {
                     @Override
                     public void propertyAdded(PropertyState after) {
                         buff.tag('+').

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeDelta.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeDelta.java?rev=1310234&r1=1310233&r2=1310234&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeDelta.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeDelta.java
Fri Apr  6 08:44:58 2012
@@ -65,7 +65,7 @@ public class NodeDelta {
             RevisionProvider provider, NodeState node1, NodeState node2) {
         this.provider = provider;
         this.node1 = node1;
-        new DiffHandler().compare(node1, node2);
+        provider.compare(node1,  node2, new DiffHandler());
     }
 
     public Map<String, String> getAddedProperties() {
@@ -173,7 +173,7 @@ public class NodeDelta {
 
     //--------------------------------------------------------< inner classes >
 
-    private class DiffHandler extends NodeStateDiff {
+    private class DiffHandler implements NodeStateDiff {
 
         @Override
         public void propertyAdded(PropertyState after) {

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStateDiff.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStateDiff.java?rev=1310234&r1=1310233&r2=1310234&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStateDiff.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStateDiff.java
Fri Apr  6 08:44:58 2012
@@ -16,148 +16,64 @@
  */
 package org.apache.jackrabbit.mk.model;
 
-import java.util.HashSet;
-import java.util.Set;
-
 /**
- * Utility base class for comparing two {@link NodeState} instances. The
- * {@link #compare(NodeState, NodeState)} method will go through all
+ * Handler of node state differences.
+ * The {@link NodeStore#compare(NodeState, NodeState, NodeStateDiff)} reports
+ * detected node state differences by calling methods of a handler instance
+ * that implements this interface. The compare 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 comparison.
+ * the ordering of properties or child nodes do not affect the comparison,
+ * and the order in which such differences are reported is unspecified.
  */
-public class NodeStateDiff {
+public interface NodeStateDiff {
 
     /**
-     * Called by {@link #compare(NodeState, NodeState)} for all added
-     * properties. The default implementation does nothing.
+     * Called for all added properties.
      *
      * @param after property state after the change
      */
-    public void propertyAdded(PropertyState after) {
-    }
+    void propertyAdded(PropertyState after);
 
     /**
-     * Called by {@link #compare(NodeState, NodeState)} for all changed
-     * properties. The names of the given two property states are guaranteed
-     * to be the same. The default implementation does nothing.
+     * Called for all changed properties. The names of the given two
+     * property states are guaranteed to be the same.
      *
      * @param before property state before the change
      * @param after property state after the change
      */
-    public void propertyChanged(PropertyState before, PropertyState after) {
-    }
+    void propertyChanged(PropertyState before, PropertyState after);
 
     /**
-     * Called by {@link #compare(NodeState, NodeState)} for all deleted
-     * properties. The default implementation does nothing.
+     * Called for all deleted properties.
      *
      * @param before property state before the change
      */
-    public void propertyDeleted(PropertyState before) {
-    }
+    void propertyDeleted(PropertyState before);
 
     /**
-     * Called by {@link #compare(NodeState, NodeState)} for all added
-     * child nodes. The default implementation does nothing.
+     * Called for all added child nodes.
      *
      * @param name name of the added child node
      * @param after child node state after the change
      */
-    public void childNodeAdded(String name, NodeState after) {
-    }
+    void childNodeAdded(String name, NodeState after);
 
     /**
-     * Called by {@link #compare(NodeState, NodeState)} for all changed
-     * child nodes. The default implementation does nothing.
+     * Called for all changed child nodes.
      *
      * @param name name of the changed child node
      * @param before child node state before the change
      * @param after child node state after the change
      */
-    public void childNodeChanged(String name, NodeState before, NodeState after) {
-    }
+    void childNodeChanged(String name, NodeState before, NodeState after);
 
     /**
-     * Called by {@link #compare(NodeState, NodeState)} for all deleted
-     * child nodes. The default implementation does nothing.
+     * Called for all deleted child nodes.
      *
      * @param name name of the deleted child node
      * @param before child node state before the change
      */
-    public void childNodeDeleted(String name, NodeState before) {
-    }
-
-    /**
-     * Compares the given two node states. Any found differences are
-     * reported by calling the relevant added, changed or deleted methods.
-     *
-     * @param before node state before changes
-     * @param after node state after changes
-     */
-    public void compare(NodeState before, NodeState after) {
-        compareProperties(before, after);
-        compareChildNodes(before, after);
-    }
-
-    /**
-     * Compares the properties of the given two node states.
-     *
-     * @param before node state before changes
-     * @param after node state after changes
-     */
-    private void compareProperties(NodeState before, NodeState after) {
-        Set<String> beforeProperties = new HashSet<String>();
-
-        for (PropertyState beforeProperty : before.getProperties()) {
-            String name = beforeProperty.getName();
-            PropertyState afterProperty = after.getProperty(name);
-            if (afterProperty == null) {
-                propertyDeleted(beforeProperty);
-            } else {
-                beforeProperties.add(name);
-                if (!beforeProperty.equals(afterProperty)) {
-                    propertyChanged(beforeProperty, afterProperty);
-                }
-            }
-        }
-
-        for (PropertyState afterProperty : after.getProperties()) {
-            if (!beforeProperties.contains(afterProperty.getName())) {
-                propertyAdded(afterProperty);
-            }
-        }
-    }
-
-    /**
-     * Compares the child nodes of the given two node states.
-     *
-     * @param before node state before changes
-     * @param after node state after changes
-     */
-    private void compareChildNodes(NodeState before, NodeState after) {
-        Set<String> beforeChildNodes = new HashSet<String>();
-
-        for (ChildNodeEntry beforeCNE : before.getChildNodeEntries(0, -1)) {
-            String name = beforeCNE.getName();
-            NodeState beforeChild = beforeCNE.getNode();
-            NodeState afterChild = after.getChildNode(name);
-            if (afterChild == null) {
-                childNodeDeleted(name, beforeChild);
-            } else {
-                beforeChildNodes.add(name);
-                if (!beforeChild.equals(afterChild)) {
-                    childNodeChanged(name, beforeChild, afterChild);
-                }
-            }
-        }
-
-        for (ChildNodeEntry afterChild : after.getChildNodeEntries(0, -1)) {
-            String name = afterChild.getName();
-            if (!beforeChildNodes.contains(name)) {
-                childNodeAdded(name, afterChild.getNode());
-            }
-        }
-    }
+    void childNodeDeleted(String name, NodeState before);
 
 }

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStore.java?rev=1310234&r1=1310233&r2=1310234&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStore.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStore.java
Fri Apr  6 08:44:58 2012
@@ -59,4 +59,15 @@ public interface NodeStore {
      */
     NodeState merge(NodeStateEditor branch, NodeState target);
 
+    /**
+     * Compares the given two node states. Any found differences are
+     * reported by calling the relevant added, changed or deleted methods
+     * of the given handler.
+     *
+     * @param before node state before changes
+     * @param after node state after changes
+     * @param diff handler of node state differences
+     */
+    void compare(NodeState before, NodeState after, NodeStateDiff diff);
+
 }

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/TraversingNodeDiffHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/TraversingNodeDiffHandler.java?rev=1310234&r1=1310233&r2=1310234&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/TraversingNodeDiffHandler.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/TraversingNodeDiffHandler.java
Fri Apr  6 08:44:58 2012
@@ -23,18 +23,20 @@ import org.apache.jackrabbit.mk.util.Pat
 /**
  *
  */
-public abstract class TraversingNodeDiffHandler extends NodeStateDiff {
+public abstract class TraversingNodeDiffHandler implements NodeStateDiff {
+
+    private final NodeStore store;
 
     protected Stack<String> paths = new Stack<String>();
 
-    public void start(NodeState before, NodeState after) {
-        start(before, after, "/");
+    public TraversingNodeDiffHandler(NodeStore store) {
+        this.store = store;
     }
 
     public void start(NodeState before, NodeState after, String path) {
         paths.clear();
         paths.push(path);
-        compare(before, after);
+        store.compare(before, after, this);
     }
 
     protected String getCurrentPath() {
@@ -45,7 +47,7 @@ public abstract class TraversingNodeDiff
     public void childNodeChanged(
             String name, NodeState before, NodeState after) {
         paths.push(PathUtils.concat(getCurrentPath(), name));
-        compare(before, after);
+        store.compare(before, after, this);
         paths.pop();
     }
 

Added: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/AbstractRevisionStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/AbstractRevisionStore.java?rev=1310234&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/AbstractRevisionStore.java
(added)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/AbstractRevisionStore.java
Fri Apr  6 08:44:58 2012
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * 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.  You may obtain a copy of the License at
+ *
+ *     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 implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.mk.store;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.jackrabbit.mk.model.ChildNodeEntry;
+import org.apache.jackrabbit.mk.model.Id;
+import org.apache.jackrabbit.mk.model.NodeState;
+import org.apache.jackrabbit.mk.model.NodeStateDiff;
+import org.apache.jackrabbit.mk.model.NodeStateEditor;
+import org.apache.jackrabbit.mk.model.PropertyState;
+import org.apache.jackrabbit.mk.model.StoredNode;
+
+/**
+ * Abstract base class for revision store implementations.
+ */
+abstract class AbstractRevisionStore implements RevisionStore {
+
+    @Override
+    public NodeState getNodeState(StoredNode node) {
+        return new StoredNodeAsState(node, this);
+    }
+
+    @Override
+    public Id getId(NodeState node) {
+        return ((StoredNodeAsState) node).getId();
+    }
+
+    @Override
+    public NodeState getRoot() {
+        Id id;
+        try {
+            id = getHeadCommitId();
+        } catch (Exception e) {
+            throw new RuntimeException(
+                    "Failed to access the head commit identifier", e);
+        }
+
+        try {
+            return getNodeState(getRootNode(id));
+        } catch (NotFoundException e) {
+            throw new IllegalStateException(
+                    "Root node not found in revision " + id, e);
+        } catch (Exception e) {
+            throw new RuntimeException(
+                    "Failed to access the root node in revision " + id, e);
+        }
+    }
+
+    @Override
+    public NodeStateEditor branch(NodeState base) {
+        throw new UnsupportedOperationException(); // TODO
+    }
+
+    @Override
+    public NodeState merge(NodeStateEditor branch, NodeState target) {
+        throw new UnsupportedOperationException(); // TODO
+    }
+
+    @Override
+    public void compare(NodeState before, NodeState after, NodeStateDiff diff) {
+        compareProperties(before, after, diff);
+        compareChildNodes(before, after, diff);
+    }
+
+    /**
+     * Compares the properties of the given two node states.
+     *
+     * @param before node state before changes
+     * @param after node state after changes
+     * @param diff handler of node state differences
+     */
+    protected void compareProperties(
+            NodeState before, NodeState after, NodeStateDiff diff) {
+        Set<String> beforeProperties = new HashSet<String>();
+
+        for (PropertyState beforeProperty : before.getProperties()) {
+            String name = beforeProperty.getName();
+            PropertyState afterProperty = after.getProperty(name);
+            if (afterProperty == null) {
+                diff.propertyDeleted(beforeProperty);
+            } else {
+                beforeProperties.add(name);
+                if (!beforeProperty.equals(afterProperty)) {
+                    diff.propertyChanged(beforeProperty, afterProperty);
+                }
+            }
+        }
+
+        for (PropertyState afterProperty : after.getProperties()) {
+            if (!beforeProperties.contains(afterProperty.getName())) {
+                diff.propertyAdded(afterProperty);
+            }
+        }
+    }
+
+    /**
+     * Compares the child nodes of the given two node states.
+     *
+     * @param before node state before changes
+     * @param after node state after changes
+     * @param diff handler of node state differences
+     */
+    protected void compareChildNodes(
+            NodeState before, NodeState after, NodeStateDiff diff) {
+        Set<String> beforeChildNodes = new HashSet<String>();
+
+        for (ChildNodeEntry beforeCNE : before.getChildNodeEntries(0, -1)) {
+            String name = beforeCNE.getName();
+            NodeState beforeChild = beforeCNE.getNode();
+            NodeState afterChild = after.getChildNode(name);
+            if (afterChild == null) {
+                diff.childNodeDeleted(name, beforeChild);
+            } else {
+                beforeChildNodes.add(name);
+                if (!beforeChild.equals(afterChild)) {
+                    diff.childNodeChanged(name, beforeChild, afterChild);
+                }
+            }
+        }
+
+        for (ChildNodeEntry afterChild : after.getChildNodeEntries(0, -1)) {
+            String name = afterChild.getName();
+            if (!beforeChildNodes.contains(name)) {
+                diff.childNodeAdded(name, afterChild.getNode());
+            }
+        }
+    }
+
+}

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/CopyingGC.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/CopyingGC.java?rev=1310234&r1=1310233&r2=1310234&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/CopyingGC.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/CopyingGC.java
Fri Apr  6 08:44:58 2012
@@ -24,7 +24,6 @@ import org.apache.jackrabbit.mk.model.Ch
 import org.apache.jackrabbit.mk.model.Id;
 import org.apache.jackrabbit.mk.model.MutableCommit;
 import org.apache.jackrabbit.mk.model.MutableNode;
-import org.apache.jackrabbit.mk.model.NodeState;
 import org.apache.jackrabbit.mk.model.StoredCommit;
 import org.apache.jackrabbit.mk.model.StoredNode;
 
@@ -36,8 +35,8 @@ import org.apache.jackrabbit.mk.model.St
  * In the current design, the head revision and all the nodes it references are
  * reachable.
  */
-public class CopyingGC implements RevisionStore {
-    
+public class CopyingGC extends AbstractRevisionStore {
+
     /**
      * From store.
      */
@@ -134,14 +133,6 @@ public class CopyingGC implements Revisi
     
     // ---------------------------------------------------------- RevisionStore
 
-    public NodeState getNodeState(StoredNode node) {
-        return new StoredNodeAsState(node, this);
-    }
-
-    public Id getId(NodeState node) {
-        return ((StoredNodeAsState) node).getId();
-    }
-
     public StoredNode getNode(Id id) throws NotFoundException, Exception {
         if (runState.get() == STARTED) {
             try {

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java?rev=1310234&r1=1310233&r2=1310234&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java
Fri Apr  6 08:44:58 2012
@@ -25,7 +25,6 @@ import org.apache.jackrabbit.mk.model.Ch
 import org.apache.jackrabbit.mk.model.Id;
 import org.apache.jackrabbit.mk.model.MutableCommit;
 import org.apache.jackrabbit.mk.model.MutableNode;
-import org.apache.jackrabbit.mk.model.NodeState;
 import org.apache.jackrabbit.mk.model.StoredCommit;
 import org.apache.jackrabbit.mk.model.StoredNode;
 import org.apache.jackrabbit.mk.persistence.Persistence;
@@ -36,7 +35,8 @@ import org.apache.jackrabbit.mk.util.Sim
  * Default revision store implementation, passing calls to a <code>Persistence</code>
  * and a <code>BlobStore</code>, respectively and providing caching. 
  */
-public class DefaultRevisionStore implements RevisionStore, Closeable {
+public class DefaultRevisionStore extends AbstractRevisionStore
+        implements Closeable {
 
     public static final String CACHE_SIZE = "mk.cacheSize";
     public static final int DEFAULT_CACHE_SIZE = 10000;
@@ -206,14 +206,6 @@ public class DefaultRevisionStore implem
 
     //-----------------------------------------------------< RevisionProvider >
 
-    public NodeState getNodeState(StoredNode node) {
-        return new StoredNodeAsState(node, this);
-    }
-
-    public Id getId(NodeState node) {
-        return ((StoredNodeAsState) node).getId();
-    }
-
     public StoredNode getNode(Id id) throws NotFoundException, Exception {
         verifyInitialized();
 
@@ -277,4 +269,5 @@ public class DefaultRevisionStore implem
             headLock.readLock().unlock();
         }
     }
+
 }

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/RevisionProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/RevisionProvider.java?rev=1310234&r1=1310233&r2=1310234&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/RevisionProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/RevisionProvider.java
Fri Apr  6 08:44:58 2012
@@ -19,13 +19,14 @@ package org.apache.jackrabbit.mk.store;
 import org.apache.jackrabbit.mk.model.ChildNodeEntriesMap;
 import org.apache.jackrabbit.mk.model.Id;
 import org.apache.jackrabbit.mk.model.NodeState;
+import org.apache.jackrabbit.mk.model.NodeStore;
 import org.apache.jackrabbit.mk.model.StoredCommit;
 import org.apache.jackrabbit.mk.model.StoredNode;
 
 /**
  * Read operations.
  */
-public interface RevisionProvider {
+public interface RevisionProvider extends NodeStore {
 
     /**
      * Adapts the given {@link StoredNode} to a corresponding



Mime
View raw message