jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1298368 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk: model/AbstractNode.java model/ChildNode.java model/Node.java model/NodeProxy.java model/StoredNode.java store/CopyingGC.java
Date Thu, 08 Mar 2012 11:40:34 GMT
Author: jukka
Date: Thu Mar  8 11:40:33 2012
New Revision: 1298368

URL: http://svn.apache.org/viewvc?rev=1298368&view=rev
Log:
OAK-3Ö Internal tree model

Remove unused code

Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/model/ChildNode.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/model/NodeProxy.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/model/AbstractNode.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/model/Node.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/model/StoredNode.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/store/CopyingGC.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/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=1298368&r1=1298367&r2=1298368&view=diff
==============================================================================
--- 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  8 11:40:33 2012
@@ -17,18 +17,11 @@
 package org.apache.jackrabbit.mk.model;
 
 import org.apache.jackrabbit.mk.store.Binding;
-import org.apache.jackrabbit.mk.store.NotFoundException;
 import org.apache.jackrabbit.mk.store.RevisionProvider;
-import org.apache.jackrabbit.mk.util.AbstractRangeIterator;
-import org.apache.jackrabbit.mk.util.EmptyIterator;
-import org.apache.jackrabbit.mk.util.PathUtils;
 
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
 
 /**
  *
@@ -87,50 +80,6 @@ public abstract class AbstractNode imple
         return childEntries.getEntries(offset, count);
     }
 
-    public Iterator<ChildNode> getChildNodes(int offset, int count)
-            throws Exception {
-        if (offset < 0 || count < -1) {
-            throw new IllegalArgumentException();
-        }
-
-        if (offset >= childEntries.getCount()) {
-            return new EmptyIterator<ChildNode>();
-        }
-
-        // todo support embedded/in-lined sub-trees
-
-        if (count == -1 || (offset + count) > childEntries.getCount()) {
-            count = childEntries.getCount() - offset;
-        }
-
-        return new AbstractRangeIterator<ChildNode>(childEntries.getEntries(offset,
count), 0, -1) {
-            @Override
-            protected ChildNode doNext() {
-                ChildNodeEntry cne = (ChildNodeEntry) it.next();
-                try {
-                    return new ChildNode(cne.getName(), provider.getNode(cne.getId()));
-                } catch (Exception e) {
-                    throw new NoSuchElementException();
-                }
-            }
-        };
-    }
-
-    public Node getNode(String relPath)
-            throws NotFoundException, Exception {
-        String[] names = PathUtils.split(relPath);
-
-        Node node = this;
-        for (String name : names) {
-            ChildNodeEntry cne = node.getChildNodeEntry(name);
-            if (cne == null) {
-                throw new NotFoundException();
-            }
-            node = provider.getNode(cne.getId());
-        }
-        return node;
-    }
-
     public void serialize(Binding binding) throws Exception {
         final Iterator<Map.Entry<String, String>> iter = properties.entrySet().iterator();
         binding.writeMap(":props", properties.size(),

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/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=1298368&r1=1298367&r2=1298368&view=diff
==============================================================================
--- 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  8 11:40:33 2012
@@ -36,8 +36,5 @@ public interface Node {
     
     Iterator<ChildNodeEntry> getChildNodeEntries(int offset, int count);
 
-    Iterator<ChildNode> getChildNodes(int offset, int count) throws Exception;
-    Node getNode(String relPath) throws NotFoundException, Exception;
-
     void serialize(Binding binding) throws Exception;
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/model/StoredNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/model/StoredNode.java?rev=1298368&r1=1298367&r2=1298368&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/model/StoredNode.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/model/StoredNode.java
Thu Mar  8 11:40:33 2012
@@ -18,7 +18,6 @@ package org.apache.jackrabbit.mk.model;
 
 import org.apache.jackrabbit.mk.store.Binding;
 import org.apache.jackrabbit.mk.store.RevisionProvider;
-import org.apache.jackrabbit.mk.store.NotFoundException;
 import org.apache.jackrabbit.mk.util.UnmodifiableIterator;
 
 import java.util.Collections;
@@ -83,16 +82,4 @@ public class StoredNode extends Abstract
         return new UnmodifiableIterator<String>(super.getChildNodeNames(offset, count));
     }
 
-    public Iterator<ChildNode> getChildNodes(int offset, int count)
-            throws Exception {
-        return new UnmodifiableIterator<ChildNode>(super.getChildNodes(offset, count));
-    }
-
-    public Node getNode(String relPath) throws NotFoundException, Exception {
-        Node result = super.getNode(relPath);
-        if (!(result instanceof StoredNode)) {
-            // todo return a StoredNode instance instead?
-        }
-        return result;
-    }
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/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=1298368&r1=1298367&r2=1298368&view=diff
==============================================================================
--- 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  8 11:40:33 2012
@@ -22,8 +22,8 @@ import java.util.Comparator;
 import java.util.Iterator;
 import java.util.TreeSet;
 
-import org.apache.jackrabbit.mk.model.ChildNode;
 import org.apache.jackrabbit.mk.model.ChildNodeEntriesMap;
+import org.apache.jackrabbit.mk.model.ChildNodeEntry;
 import org.apache.jackrabbit.mk.model.Id;
 import org.apache.jackrabbit.mk.model.MutableCommit;
 import org.apache.jackrabbit.mk.model.MutableNode;
@@ -161,11 +161,11 @@ public class CopyingGC implements Revisi
             // ignore, better add a has() method
         }
         rsTo.putNode(new MutableNode(node, rsTo));
-        
-        Iterator<ChildNode> iter = node.getChildNodes(0, -1);
+
+        Iterator<ChildNodeEntry> iter = node.getChildNodeEntries(0, -1);
         while (iter.hasNext()) {
-            ChildNode c = iter.next();
-            copy(c.getNode());
+            ChildNodeEntry c = iter.next();
+            copy(rsFrom.getNode(c.getId()));
         }
     }
     



Mime
View raw message