jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsedd...@apache.org
Subject svn commit: r1740826 - in /jackrabbit/branches/2.10: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.java
Date Mon, 25 Apr 2016 12:18:22 GMT
Author: jsedding
Date: Mon Apr 25 12:18:22 2016
New Revision: 1740826

URL: http://svn.apache.org/viewvc?rev=1740826&view=rev
Log:
JCR-3971 - Make read-permission cache-size in CompiledPermissionsImpl configurable

- merged to branches/2.10

Modified:
    jackrabbit/branches/2.10/   (props changed)
    jackrabbit/branches/2.10/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.java

Propchange: jackrabbit/branches/2.10/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 25 12:18:22 2016
@@ -1,3 +1,3 @@
 /jackrabbit/branches/JCR-2272:1173165-1176545
 /jackrabbit/sandbox/JCR-2415-lucene-3.0:1060860-1064038
-/jackrabbit/trunk:1729382,1732436
+/jackrabbit/trunk:1729382,1732436,1740814

Modified: jackrabbit/branches/2.10/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.10/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.java?rev=1740826&r1=1740825&r2=1740826&view=diff
==============================================================================
--- jackrabbit/branches/2.10/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.java
(original)
+++ jackrabbit/branches/2.10/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.java
Mon Apr 25 12:18:22 2016
@@ -36,6 +36,8 @@ import org.apache.jackrabbit.core.securi
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.util.Text;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.jcr.ItemNotFoundException;
 import javax.jcr.RepositoryException;
@@ -51,6 +53,15 @@ import java.util.Set;
  */
 class CompiledPermissionsImpl extends AbstractCompiledPermissions implements AccessControlListener
{
 
+    private static final Logger LOG = LoggerFactory.getLogger(CompiledPermissionsImpl.class);
+
+    public static final int DEFAULT_MAX_CACHE_SIZE = 5000;
+
+    public static final int MAX_CACHE_SIZE = Integer.getInteger(
+            "org.apache.jackrabbit.core.security.authorization.acl.CompiledPermissionsImpl.cacheSize",
+            DEFAULT_MAX_CACHE_SIZE
+    );
+
     private final List<String> principalNames;
     private final SessionImpl session;
     private final EntryCollector entryCollector;
@@ -61,7 +72,7 @@ class CompiledPermissionsImpl extends Ab
      * removing LRU items.
      */
     @SuppressWarnings("unchecked")
-    private final Map<ItemId, Boolean> readCache = new GrowingLRUMap(1024, 5000);
+    private final Map<ItemId, Boolean> readCache = new GrowingLRUMap(1024, MAX_CACHE_SIZE);
 
     private final Object monitor = new Object();
 
@@ -84,6 +95,8 @@ class CompiledPermissionsImpl extends Ab
             */
             entryCollector.addListener(this);
         }
+
+        LOG.debug("Read permission cache size = {}", MAX_CACHE_SIZE);
     }
 
     private Result buildResult(NodeImpl node, boolean isExistingNode,



Mime
View raw message