jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1095965 - in /jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk: MicroKernelImpl.java store/Node.java
Date Fri, 22 Apr 2011 17:13:42 GMT
Author: stefan
Date: Fri Apr 22 17:13:42 2011
New Revision: 1095965

URL: http://svn.apache.org/viewvc?rev=1095965&view=rev
Log:
MicroKernel prototype (WIP)

Modified:
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/Node.java

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java?rev=1095965&r1=1095964&r2=1095965&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
Fri Apr 22 17:13:42 2011
@@ -163,7 +163,7 @@ public class MicroKernelImpl implements 
         }
 
         try {
-            return rep.getNode(path, revisionId).getChildNodeEntries().size();
+            return rep.getNode(path, revisionId).getChildNodeCount();
         } catch (Exception e) {
             throw new MicroKernelException(e);
         }
@@ -222,8 +222,7 @@ public class MicroKernelImpl implements 
         }
 
         buf.append("\":childNodeCount\":\"");
-        // todo optimize
-        int childCount = node.getChildNodeEntries().size();
+        long childCount = node.getChildNodeCount();
         buf.append(childCount);
         buf.append("\"");
         if (childCount > 0 && depth > 0) {

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/Node.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/Node.java?rev=1095965&r1=1095964&r2=1095965&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/Node.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/Node.java
Fri Apr 22 17:13:42 2011
@@ -55,6 +55,15 @@ public class Node extends StoredObject {
         return Collections.unmodifiableMap(childEntries);
     }
 
+    /**
+     * Returns the number of child nodes.
+     *
+     * @return
+     */
+    public long getChildNodeCount() {
+        return childEntries.size();
+    }
+
     //--------------------------------------------------------< serialization >
 
     public static Node fromBytes(String id, byte[] data) throws Exception {



Mime
View raw message