jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From am...@apache.org
Subject svn commit: r1769767 - /jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/data/CachingDataStore.java
Date Tue, 15 Nov 2016 09:56:51 GMT
Author: amitj
Date: Tue Nov 15 09:56:51 2016
New Revision: 1769767

URL: http://svn.apache.org/viewvc?rev=1769767&view=rev
Log:
JCR-4007: CachingDataStore - touching every time on getRecord() was unnecessary

Patch from Woonsan Ko

Modified:
    jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/data/CachingDataStore.java

Modified: jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/data/CachingDataStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/data/CachingDataStore.java?rev=1769767&r1=1769766&r2=1769767&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/data/CachingDataStore.java
(original)
+++ jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/data/CachingDataStore.java
Tue Nov 15 09:56:51 2016
@@ -149,7 +149,7 @@ public abstract class CachingDataStore e
     private File tmpDir;
 
     private String secret;
-    
+
     /**
      * Flag to indicate if lastModified is updated asynchronously.
      */
@@ -467,7 +467,9 @@ public abstract class CachingDataStore e
             if (getLength(identifier) > -1) {
                 LOG.trace("getRecord: [{}]  retrieved using getLength",
                     identifier);
-                touchInternal(identifier);
+                if (minModifiedDate > 0) {
+                    touchInternal(identifier);
+                }
                 usesIdentifier(identifier);
                 return new CachingDataRecord(this, identifier);
             } else if (asyncWriteCache.hasEntry(fileName, minModifiedDate > 0)) {
@@ -505,7 +507,9 @@ public abstract class CachingDataStore e
                 LOG.trace(
                     "getRecordIfStored: [{}]  retrieved using recLenCache",
                     identifier);
-                touchInternal(identifier);
+                if (minModifiedDate > 0) {
+                    touchInternal(identifier);
+                }
                 usesIdentifier(identifier);
                 return new CachingDataRecord(this, identifier);
             } else {
@@ -515,7 +519,9 @@ public abstract class CachingDataStore e
                         "getRecordIfStored :[{}]  retrieved from backend",
                         identifier);
                     recLenCache.put(identifier, length);
-                    touchInternal(identifier);
+                    if (minModifiedDate > 0) {
+                        touchInternal(identifier);
+                    }
                     usesIdentifier(identifier);
                     return new CachingDataRecord(this, identifier);
                 } catch (DataStoreException ignore) {



Mime
View raw message