You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by th...@apache.org on 2013/09/25 17:20:19 UTC

svn commit: r1526204 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk: MongoMK.java NodeDocument.java

Author: thomasm
Date: Wed Sep 25 15:20:18 2013
New Revision: 1526204

URL: http://svn.apache.org/r1526204
Log:
OAK-98 Code conventions, Javadocs

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/NodeDocument.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java?rev=1526204&r1=1526203&r2=1526204&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java Wed Sep 25 15:20:18 2013
@@ -75,8 +75,6 @@ import static com.google.common.base.Pre
  */
 public class MongoMK implements MicroKernel, RevisionContext {
 
-    private static final Logger LOG = LoggerFactory.getLogger(MongoMK.class);
-
     /**
      * The threshold where special handling for many child node starts.
      */
@@ -89,6 +87,8 @@ public class MongoMK implements MicroKer
     static final boolean LIRS_CACHE = Boolean.parseBoolean(
             System.getProperty("oak.mongoMK.lirsCache", "false"));
 
+    private static final Logger LOG = LoggerFactory.getLogger(MongoMK.class);
+
     /**
      * Do not cache more than this number of children for a document.
      */
@@ -121,6 +121,11 @@ public class MongoMK implements MicroKer
     private static final int REMEMBER_REVISION_ORDER_MILLIS = 60 * 60 * 1000;
 
     /**
+     * The MongoDB store (might be used by multiple MongoMKs).
+     */
+    protected final DocumentStore store;
+
+    /**
      * The delay for asynchronous operations (delayed commit propagation and
      * cache update).
      */
@@ -132,11 +137,6 @@ public class MongoMK implements MicroKer
     private final AtomicBoolean isDisposed = new AtomicBoolean();
 
     /**
-     * The MongoDB store (might be used by multiple MongoMKs).
-     */
-    private final DocumentStore store;
-
-    /**
      * The MongoDB blob store.
      */
     private final BlobStore blobStore;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/NodeDocument.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/NodeDocument.java?rev=1526204&r1=1526203&r2=1526204&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/NodeDocument.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/NodeDocument.java Wed Sep 25 15:20:18 2013
@@ -283,7 +283,6 @@ public class NodeDocument extends Docume
      *                preceding <code>changeRev</code>.
      * @return the revision, or null if deleted
      */
-    @SuppressWarnings("unchecked")
     @CheckForNull
     public Revision getNewestRevision(RevisionContext context,
                                       Revision changeRev,
@@ -671,8 +670,8 @@ public class NodeDocument extends Docume
      * @param property the name of a property.
      * @return previous documents.
      */
-    Iterable<NodeDocument> getPreviousDocs(final @Nullable Revision revision,
-                                           final @Nonnull String property) {
+    Iterable<NodeDocument> getPreviousDocs(@Nullable final Revision revision,
+                @Nonnull final String property) {
         checkNotNull(property);
         Iterable<NodeDocument> docs = Iterables.transform(
                 Iterables.filter(getPreviousRanges().entrySet(),
@@ -783,21 +782,6 @@ public class NodeDocument extends Docume
                 String.valueOf(deleted));
     }
 
-    static final class Children implements CacheValue {
-
-        final List<String> childNames = new ArrayList<String>();
-        boolean isComplete;
-
-        @Override
-        public int getMemory() {
-            int size = 8;
-            for (String name : childNames) {
-                size += name.length() * 2 + 8;
-            }
-            return size;
-        }
-    }
-
     //----------------------------< internal >----------------------------------
 
     /**
@@ -974,7 +958,37 @@ public class NodeDocument extends Docume
     private Map<Revision, String> getCommitRoot() {
         return ValueMap.create(this, COMMIT_ROOT);
     }
+    
+    /**
+     * The list of children for a node. The list might be complete or not, in
+     * which case it only represents a block of children.
+     */
+    static final class Children implements CacheValue {
+
+        /**
+         * The child node names, ordered as stored in MongoDB.
+         */
+        final List<String> childNames = new ArrayList<String>();
+        
+        /**
+         * Whether the list is complete (in which case there are no other
+         * children) or not.
+         */
+        boolean isComplete;
+
+        @Override
+        public int getMemory() {
+            int size = 8;
+            for (String name : childNames) {
+                size += name.length() * 2 + 8;
+            }
+            return size;
+        }
+    }
 
+    /**
+     * A property value / revision combination.
+     */
     private static final class Value {
 
         final String value;