jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1292443 - in /jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk: blobs/ mem/ simple/
Date Wed, 22 Feb 2012 18:43:15 GMT
Author: thomasm
Date: Wed Feb 22 18:43:14 2012
New Revision: 1292443

URL: http://svn.apache.org/viewvc?rev=1292443&view=rev
Log:
Cleanup, hide implementation details.

Removed:
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/mem/
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeIdInline.java
Modified:
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeId.java
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeListSmall.java
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeMap.java
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeMapInDb.java
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeMapInMongoDb.java

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java?rev=1292443&r1=1292442&r2=1292443&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java
Wed Feb 22 18:43:14 2012
@@ -80,7 +80,7 @@ public abstract class AbstractBlobStore 
     private int blockSizeMin = 256;
 
     /**
-     * The size of a block. 128 * 1024 (128 KB) has been found to be as fast as larger
+     * The size of a block. 128 KB has been found to be as fast as larger
      * values, and faster than smaller values. 2 MB results in less files.
      */
     private int blockSize = 2 * 1024 * 1024;

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeId.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeId.java?rev=1292443&r1=1292442&r2=1292443&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeId.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeId.java
Wed Feb 22 18:43:14 2012
@@ -34,6 +34,10 @@ public class NodeId {
         return new NodeId(x);
     }
 
+    public static NodeId getInline(NodeImpl n) {
+        return new NodeIdInline(n);
+    }
+
     public NodeImpl getNode(NodeMap map) {
         return map.getNode(x);
     }
@@ -58,4 +62,30 @@ public class NodeId {
         this.hash = hash;
     }
 
+    /**
+     * An node id of an inline node (a node that is stored within the parent).
+     */
+    private static class NodeIdInline extends NodeId {
+
+        private final NodeImpl node;
+
+        protected NodeIdInline(NodeImpl node) {
+            super(0);
+            this.node = node;
+        }
+
+        public NodeImpl getNode(NodeMap map) {
+            return node;
+        }
+
+        public String toString() {
+            return node.toString();
+        }
+
+        public boolean isInline() {
+            return true;
+        }
+
+    }
+
 }

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeListSmall.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeListSmall.java?rev=1292443&r1=1292442&r2=1292443&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeListSmall.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeListSmall.java
Wed Feb 22 18:43:14 2012
@@ -47,7 +47,7 @@ public class NodeListSmall implements No
     /**
      * The child node ids.
      */
-    NodeId[] children;
+    private NodeId[] children;
 
     /**
      * The sort index.

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeMap.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeMap.java?rev=1292443&r1=1292442&r2=1292443&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeMap.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeMap.java
Wed Feb 22 18:43:14 2012
@@ -55,7 +55,7 @@ public class NodeMap {
         NodeId x = node.getId();
         if (x == null) {
             if (allowInline && node.getDescendantInlineCount() < descendantInlineCount)
{
-                x = new NodeIdInline(node);
+                x = NodeId.getInline(node);
             } else {
                 x = NodeId.get(nextId.incrementAndGet());
                 nodes.put(x.getLong(), node);
@@ -152,7 +152,7 @@ public class NodeMap {
 
     protected NodeId parseInline(String id) {
         NodeImpl inline = NodeImpl.fromString(this, id);
-        NodeId inlineId = new NodeIdInline(inline);
+        NodeId inlineId = NodeId.getInline(inline);
         inline.setId(inlineId);
         return inlineId;
     }

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeMapInDb.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeMapInDb.java?rev=1292443&r1=1292442&r2=1292443&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeMapInDb.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeMapInDb.java
Wed Feb 22 18:43:14 2012
@@ -80,7 +80,7 @@ public class NodeMapInDb extends NodeMap
         NodeId x = node.getId();
         if (x == null) {
             if (allowInline && node.getDescendantInlineCount() < descendantInlineCount)
{
-                x = new NodeIdInline(node);
+                x = NodeId.getInline(node);
             } else {
                 long t = -temp.size() - 1;
                 temp.put(t, node);

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeMapInMongoDb.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeMapInMongoDb.java?rev=1292443&r1=1292442&r2=1292443&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeMapInMongoDb.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/simple/NodeMapInMongoDb.java
Wed Feb 22 18:43:14 2012
@@ -87,7 +87,7 @@ public class NodeMapInMongoDb extends No
         NodeId x = node.getId();
         if (x == null) {
             if (allowInline && node.getDescendantInlineCount() < descendantInlineCount)
{
-                x = new NodeIdInline(node);
+                x = NodeId.getInline(node);
             } else {
                 long t = -temp.size() - 1;
                 temp.put(t, node);



Mime
View raw message