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 th...@apache.org on 2016/10/28 13:10:58 UTC
svn commit: r1767018 -
/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/persistentCache/PersistentCache.java
Author: thomasm
Date: Fri Oct 28 13:10:58 2016
New Revision: 1767018
URL: http://svn.apache.org/viewvc?rev=1767018&view=rev
Log:
OAK-5006 Persistent cache: improve concurrency
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=1767018&r1=1767017&r2=1767018&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 Fri Oct 28 13:10:58 2016
@@ -81,6 +81,7 @@ public class PersistentCache implements
private MapFactory writeStore;
private MapFactory readStore;
private int maxSizeMB = 1024;
+ private int memCache = -1;
private int readGeneration = -1;
private int writeGeneration;
private long maxBinaryEntry = 1024 * 1024;
@@ -137,6 +138,8 @@ public class PersistentCache implements
dir += "-" + System.currentTimeMillis() + "-" + COUNTER.getAndIncrement();
} else if (p.startsWith("size=")) {
maxSizeMB = Integer.parseInt(p.split("=")[1]);
+ } else if (p.startsWith("memCache=")) {
+ memCache = Integer.parseInt(p.split("=")[1]);
} else if (p.startsWith("binary=")) {
maxBinaryEntry = Long.parseLong(p.split("=")[1]);
} else if (p.startsWith("autoCompact=")) {
@@ -263,6 +266,9 @@ public class PersistentCache implements
if (fileName != null) {
builder.fileName(fileName);
}
+ if (memCache >= 0) {
+ builder.cacheSize(memCache);
+ }
if (readOnly) {
builder.readOnly();
}