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 re...@apache.org on 2014/11/24 16:13:35 UTC

svn commit: r1641406 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java

Author: reschke
Date: Mon Nov 24 15:13:34 2014
New Revision: 1641406

URL: http://svn.apache.org/r1641406
Log:
OAK-1941 - remove system-property-based switch to disable cache updates from queries

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java?rev=1641406&r1=1641405&r2=1641406&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.java Mon Nov 24 15:13:34 2014
@@ -938,8 +938,6 @@ public class RDBDocumentStore implements
     private static boolean NOGZIP = Boolean.getBoolean("org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.NOGZIP");
     // Number of documents to insert at once for batch create
     private static int CHUNKSIZE = Integer.getInteger("org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.CHUNKSIZE", 64);
-    // Whether to use cache for query results
-    private static boolean NOQUERYFROMCACHE = Boolean.getBoolean("org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore.NOQUERYFROMCACHE");
 
     private static byte[] asBytes(String data) {
         byte[] bytes;
@@ -1360,20 +1358,18 @@ public class RDBDocumentStore implements
         NodeDocument inCache = nodesCache.getIfPresent(cacheKey);
         Number modCount = row.getModcount();
 
-        if (! NOQUERYFROMCACHE) {
-            // do not overwrite document in cache if the
-            // existing one in the cache is newer
-            if (inCache != null && inCache != NodeDocument.NULL) {
-                // check mod count
-                Number cachedModCount = inCache.getModCount();
-                if (cachedModCount == null) {
-                    throw new IllegalStateException("Missing " + Document.MOD_COUNT);
-                }
-                if (modCount.longValue() <= cachedModCount.longValue()) {
-                    // we can use the cached document
-                    inCache.markUpToDate(now);
-                    return (T) inCache;
-                }
+        // do not overwrite document in cache if the
+        // existing one in the cache is newer
+        if (inCache != null && inCache != NodeDocument.NULL) {
+            // check mod count
+            Number cachedModCount = inCache.getModCount();
+            if (cachedModCount == null) {
+                throw new IllegalStateException("Missing " + Document.MOD_COUNT);
+            }
+            if (modCount.longValue() <= cachedModCount.longValue()) {
+                // we can use the cached document
+                inCache.markUpToDate(now);
+                return (T) inCache;
             }
         }