jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1547018 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk: CacheInvalidator.java MongoDocumentStore.java MongoMK.java NodeDocument.java
Date Mon, 02 Dec 2013 13:43:58 GMT
Author: thomasm
Date: Mon Dec  2 13:43:57 2013
New Revision: 1547018

URL: http://svn.apache.org/r1547018
Log:
OAK-98 Source code formatting, code conventions, Javadocs

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/CacheInvalidator.java
    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/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/CacheInvalidator.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/CacheInvalidator.java?rev=1547018&r1=1547017&r2=1547018&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/CacheInvalidator.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/CacheInvalidator.java
Mon Dec  2 13:43:57 2013
@@ -334,7 +334,7 @@ abstract class CacheInvalidator {
             public boolean isUptodate(long time) {
                 NodeDocument doc = documentStore.getIfCached(Collection.NODES, id);
                 if (doc != null) {
-                    return doc.isUptodate(time);
+                    return doc.isUpToDate(time);
                 } else {
                     //If doc is not present in cache then its already
                     //uptodate i.e. no further consistency check required
@@ -383,7 +383,7 @@ abstract class CacheInvalidator {
 
                 if (doc.getCreated() >= uptodateRoot.getCreated()
                         || doc.getLastCheckTime() == uptodateRoot.getLastCheckTime()) {
-                    doc.markUptodate(time);
+                    doc.markUpToDate(time);
                 }
             }
 

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=1547018&r1=1547017&r2=1547018&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
Mon Dec  2 13:43:57 2013
@@ -277,7 +277,7 @@ public class MongoDocumentStore implemen
                             Number modCount = doc.getModCount();
                             if (cachedModCount == null || modCount == null) {
                                 throw new IllegalStateException(
-                                        "Missing " + NodeDocument.MOD_COUNT);
+                                        "Missing " + Document.MOD_COUNT);
                             }
                             if (modCount.longValue() > cachedModCount.longValue()) {
                                 nodesCache.put(id, (NodeDocument) doc);

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=1547018&r1=1547017&r2=1547018&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
Mon Dec  2 13:43:57 2013
@@ -196,7 +196,8 @@ public class MongoMK implements MicroKer
         if (from == null || to == null) {
             // TODO implement correct behavior if the node does't/didn't exist
             String msg = String.format("Diff is only supported if the node exists in both
cases. " +
-                    "Node [%s], fromRev [%s] -> %s, toRev [%s] -> %s",path,fromRev,
from != null, toRev, to != null);
+                    "Node [%s], fromRev [%s] -> %s, toRev [%s] -> %s",
+                    path, fromRev, from != null, toRev, to != null);
             throw new MicroKernelException(msg);
         }
         JsopWriter w = new JsopStream();

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=1547018&r1=1547017&r2=1547018&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
Mon Dec  2 13:43:57 2013
@@ -130,7 +130,7 @@ public class NodeDocument extends Docume
     /**
      * The last revision. Key: machine id, value: revision.
      */
-    static final String LAST_REV = "_lastRev";
+    private static final String LAST_REV = "_lastRev";
 
     /**
      * Flag indicating that there are child nodes present. Its just used as a hint.
@@ -205,24 +205,30 @@ public class NodeDocument extends Docume
     }
 
     /**
-     * Mark this instance as up-to-date wrt state in persistence store
+     * Mark this instance as up-to-date (matches the state in persistence
+     * store).
+     * 
      * @param checkTime time at which the check was performed
      */
-    public void markUptodate(long checkTime){
-        this.lastCheckTime.set(checkTime);
+    public void markUpToDate(long checkTime) {
+        lastCheckTime.set(checkTime);
     }
 
     /**
      * Returns true if the document has already been checked for consistency
-     * in current cycle
+     * in current cycle.
+     * 
      * @param lastCheckTime time at which current cycle started
+     * @return if the document was checked
      */
-    public boolean isUptodate(long lastCheckTime){
+    public boolean isUpToDate(long lastCheckTime) {
         return lastCheckTime <= this.lastCheckTime.get();
     }
 
     /**
-     * Returns the last time when this object was checked for consistency
+     * Returns the last time when this object was checked for consistency.
+     * 
+     * @return the last check time
      */
     public long getLastCheckTime() {
         return lastCheckTime.get();



Mime
View raw message