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/12/04 11:20:24 UTC
svn commit: r1547749 - in
/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk:
MongoDocumentStore.java NodeDocument.java
Author: thomasm
Date: Wed Dec 4 10:20:23 2013
New Revision: 1547749
URL: http://svn.apache.org/r1547749
Log:
OAK-98 Source code formatting, code conventions, Javadocs
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoDocumentStore.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/MongoDocumentStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoDocumentStore.java?rev=1547749&r1=1547748&r2=1547749&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoDocumentStore.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoDocumentStore.java Wed Dec 4 10:20:23 2013
@@ -328,8 +328,9 @@ public class MongoDocumentStore implemen
Number modCount = null;
T cachedDoc = null;
if (collection == Collection.NODES) {
- //noinspection unchecked
- cachedDoc = (T) nodesCache.getIfPresent(updateOp.getId());
+ @SuppressWarnings("unchecked")
+ T doc = (T) nodesCache.getIfPresent(updateOp.getId());
+ cachedDoc = doc;
if (cachedDoc != null) {
modCount = cachedDoc.getModCount();
}
@@ -585,10 +586,11 @@ public class MongoDocumentStore implemen
if (collection != Collection.NODES) {
return null;
}
- return (T) nodesCache.getIfPresent(key);
+ @SuppressWarnings("unchecked")
+ T doc = (T) nodesCache.getIfPresent(key);
+ return doc;
}
-
/**
* Applies an update to the nodes cache. This method does not acquire
* a lock for the document. The caller must ensure it holds a lock for
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=1547749&r1=1547748&r2=1547749&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 Dec 4 10:20:23 2013
@@ -89,7 +89,7 @@ public class NodeDocument extends Docume
/**
* Revision collision markers set by commits with modifications, which
* overlap with un-merged branch commits.
- * Key: revision, value:
+ * Key: revision, value: always true
*/
static final String COLLISIONS = "_collisions";
@@ -103,7 +103,8 @@ public class NodeDocument extends Docume
/**
* The list of revision to root commit depth mappings to find out if a
- * revision is actually committed.
+ * revision is actually committed. Depth 0 means the commit is in the root node,
+ * depth 1 means one node below the root, and so on.
*/
private static final String COMMIT_ROOT = "_commitRoot";
@@ -112,6 +113,10 @@ public class NodeDocument extends Docume
* this node). This property is only set if multiple documents per node
* exist. This is the case when a node is updated very often in a short
* time, such that the document gets very big.
+ * <p>
+ * Key: high revision
+ * <p>
+ * Value: low revision
*/
private static final String PREVIOUS = "_prev";
@@ -122,13 +127,22 @@ public class NodeDocument extends Docume
/**
* The list of recent revisions for this node, where this node is the
- * root of the commit. Key: revision, value: true or the base revision of an
- * un-merged branch commit.
+ * root of the commit.
+ * <p>
+ * Key: revision.
+ * <p>
+ * Value: "c" for a regular (non-branch) commit,
+ * "c-" + base revision of the successfully merged branch commit,
+ * "b" + base revision of an un-merged branch commit
*/
private static final String REVISIONS = "_revisions";
/**
- * The last revision. Key: machine id, value: revision.
+ * The last revision.
+ * <p>
+ * Key: machine id, in the form "r0-0-1".
+ * <p>
+ * Value: the revision.
*/
private static final String LAST_REV = "_lastRev";