jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chet...@apache.org
Subject svn commit: r1600880 - in /jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/data: CachingDataStore.java LocalCache.java
Date Fri, 06 Jun 2014 13:14:30 GMT
Author: chetanm
Date: Fri Jun  6 13:14:30 2014
New Revision: 1600880

URL: http://svn.apache.org/r1600880
Log:
JCR-3786 - Incompatible CachingDataStore's path & FileDataStore's path configuration

Applying patch from Shashank

Modified:
    jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/data/CachingDataStore.java
    jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/data/LocalCache.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=1600880&r1=1600879&r2=1600880&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
Fri Jun  6 13:14:30 2014
@@ -219,13 +219,10 @@ public abstract class CachingDataStore e
         try {
             if (path == null) {
                 path = homeDir + "/repository/datastore";
-                tmpDir = new File(homeDir, "/repository/s3tmp");
-            } else {
-                // cache is moved from 'path' to 'path'/repository/datastore
-                tmpDir = new File(path, "/repository/s3tmp");
-                path = path + "/repository/datastore";
             }
-            LOG.info("path=[{}],  tmpPath=[{}]", path, tmpDir.getPath());
+            // create tmp inside path
+            tmpDir = new File(path, "tmp");
+            LOG.info("path=[{}],  tmpPath=[{}]", path, tmpDir.getAbsolutePath());
             directory = new File(path);
             mkdirs(directory);
             if (!mkdirs(tmpDir)) {

Modified: jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/data/LocalCache.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/data/LocalCache.java?rev=1600880&r1=1600879&r2=1600880&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/data/LocalCache.java
(original)
+++ jackrabbit/trunk/jackrabbit-data/src/main/java/org/apache/jackrabbit/core/data/LocalCache.java
Fri Jun  6 13:14:30 2014
@@ -572,12 +572,20 @@ public class LocalCache {
             LOG.debug("Time taken to sort [{}] took [{}] sec",
                 allFiles.size(), ((t2 - t1) / 1000));
             String dataStorePath = directory.getAbsolutePath();
+            String tmpPath = tmp.getAbsolutePath();
+            LOG.debug("tmp path [{}]", tmpPath); 
             long time = System.currentTimeMillis();
             int count = 0;
             for (File f : allFiles) {
                 if (f.exists()) {
                     count++;
                     String name = f.getPath();
+                    String filePath = f.getAbsolutePath();
+                    // skipped any temp file
+                    if(filePath.startsWith(tmpPath) ) {
+                        LOG.info    ("tmp file [{}] skipped ", filePath);
+                        continue;
+                    }
                     if (name.startsWith(dataStorePath)) {
                         name = name.substring(dataStorePath.length());
                     }



Mime
View raw message