jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1530005 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/MembershipCache.java
Date Mon, 07 Oct 2013 17:21:08 GMT
Author: jukka
Date: Mon Oct  7 17:21:08 2013
New Revision: 1530005

URL: http://svn.apache.org/r1530005
Log:
JCR-3678: MembershipCache max size is hard coded to 5000

Allow the cache size to be controlled with a system property.
We can turn this into a proper repository configuration parameter
if the need to change the cache size is a common enough.

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/MembershipCache.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/MembershipCache.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/MembershipCache.java?rev=1530005&r1=1530004&r2=1530005&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/MembershipCache.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/MembershipCache.java
Mon Oct  7 17:21:08 2013
@@ -57,9 +57,10 @@ public class MembershipCache implements 
     private static final Logger log = LoggerFactory.getLogger(MembershipCache.class);
 
     /**
-     * The maximum size of this cache (TODO: make configurable)
+     * The maximum size of this cache
      */
-    private static final int MAX_CACHE_SIZE = 5000;
+    private static final int MAX_CACHE_SIZE =
+            Integer.getInteger("org.apache.jackrabbit.MembershipCache", 5000);
 
     private final SessionImpl systemSession;
     private final String groupsPath;
@@ -67,7 +68,6 @@ public class MembershipCache implements 
     private final String pMembers;
     private final ConcurrentCache<String, Collection<String>> cache;
 
-    @SuppressWarnings("unchecked")
     MembershipCache(SessionImpl systemSession, String groupsPath, boolean useMembersNode)
throws RepositoryException {
         this.systemSession = systemSession;
         this.groupsPath = (groupsPath == null) ? UserConstants.GROUPS_PATH : groupsPath;



Mime
View raw message