jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shash...@apache.org
Subject svn commit: r1678123 - /jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/data/CachingDataStore.java
Date Thu, 07 May 2015 03:47:56 GMT
Author: shashank
Date: Thu May  7 03:47:55 2015
New Revision: 1678123

URL: http://svn.apache.org/r1678123
Log:
JCR-3879 Remove contention in AsyncUploadCache to improve performance

fixed. Reversed the if condition block to reduce the dependency of synchronized access to
asycuploadCache. 

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=1678123&r1=1678122&r2=1678123&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
Thu May  7 03:47:55 2015
@@ -464,15 +464,15 @@ public abstract class CachingDataStore e
                     throws DataStoreException {
         String fileName = getFileName(identifier);
         try {
-            if (asyncWriteCache.hasEntry(fileName, minModifiedDate > 0)) {
-                LOG.trace("getRecord: [{}]  retrieved from asyncUploadmap",
+            if (getLength(identifier) > -1) {
+                LOG.trace("getRecord: [{}]  retrieved using getLength",
                     identifier);
+                touchInternal(identifier);
                 usesIdentifier(identifier);
                 return new CachingDataRecord(this, identifier);
-            } else if (getLength(identifier) > -1) {
-                LOG.trace("getRecord: [{}]  retrieved using getLength",
+            } else if (asyncWriteCache.hasEntry(fileName, minModifiedDate > 0)) {
+                LOG.trace("getRecord: [{}]  retrieved from asyncUploadmap",
                     identifier);
-                touchInternal(identifier);
                 usesIdentifier(identifier);
                 return new CachingDataRecord(this, identifier);
             }



Mime
View raw message