Author: thomasm
Date: Tue Mar 24 10:24:29 2015
New Revision: 1668835
URL: http://svn.apache.org/r1668835
Log:
OAK-2671 Persistent cache: use different files in tests
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/persistentCache/PersistentCache.java
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/persistentCache/PersistentCache.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/persistentCache/PersistentCache.java?rev=1668835&r1=1668834&r2=1668835&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/persistentCache/PersistentCache.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/persistentCache/PersistentCache.java
Tue Mar 24 10:24:29 2015
@@ -20,6 +20,7 @@ import java.io.File;
import java.util.ArrayList;
import java.util.Map;
import java.util.TreeSet;
+import java.util.concurrent.atomic.AtomicInteger;
import org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore;
import org.apache.jackrabbit.oak.plugins.document.DocumentStore;
@@ -43,6 +44,7 @@ public class PersistentCache {
private static final String FILE_PREFIX = "cache-";
private static final String FILE_SUFFIX = ".data";
+ private static final AtomicInteger COUNTER = new AtomicInteger();
private boolean cacheNodes = true;
private boolean cacheChildren = true;
@@ -87,7 +89,7 @@ public class PersistentCache {
} else if (p.equals("-compress")) {
compress = false;
} else if (p.endsWith("time")) {
- dir += "-" + System.currentTimeMillis();
+ dir += "-" + System.currentTimeMillis() + "-" +
COUNTER.getAndIncrement();
} else if (p.startsWith("size=")) {
maxSizeMB = Integer.parseInt(p.split("=")[1]);
} else if (p.startsWith("binary=")) {