jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1404084 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/plugins/nodetype/ main/java/org/apache/jackrabbit/oak/security/user/ test/resources/org/apache/jackrabbit/oak/query/
Date Wed, 31 Oct 2012 10:40:58 GMT
Author: mreutegg
Date: Wed Oct 31 10:40:57 2012
New Revision: 1404084

URL: http://svn.apache.org/viewvc?rev=1404084&view=rev
Log:
OAK-41: Initial repository setup
- create index for rep:members to speed up membership lookup

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/InitialContent.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/MembershipProvider.java
    jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/sql2.txt

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/InitialContent.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/InitialContent.java?rev=1404084&r1=1404083&r2=1404084&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/InitialContent.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/InitialContent.java
Wed Oct 31 10:40:57 2012
@@ -22,6 +22,7 @@ import org.apache.jackrabbit.oak.api.Com
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.core.RootImpl;
 import org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer;
+import org.apache.jackrabbit.oak.spi.security.user.UserConstants;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 import org.apache.jackrabbit.oak.spi.state.NodeStoreBranch;
@@ -105,15 +106,20 @@ public class InitialContent implements R
             index.child("authorizableId")
                 .setProperty("jcr:primaryType", "oak:queryIndexDefinition", Type.NAME)
                 .setProperty("type", "property")
-                .setProperty("propertyNames", "rep:authorizableId")
+                .setProperty("propertyNames", UserConstants.REP_AUTHORIZABLE_ID)
                 .setProperty("reindex", true)
                 .setProperty("unique", true);
             index.child("principalName")
                 .setProperty("jcr:primaryType", "oak:queryIndexDefinition", Type.NAME)
                 .setProperty("type", "property")
-                .setProperty("propertyNames", "rep:principalName")
+                .setProperty("propertyNames", UserConstants.REP_PRINCIPAL_NAME)
                 .setProperty("reindex", true)
                 .setProperty("unique", true);
+            index.child("members")
+                .setProperty("jcr:primaryType", "oak:queryIndexDefinition", Type.NAME)
+                .setProperty("type", "property")
+                .setProperty("propertyNames", UserConstants.REP_MEMBERS)
+                .setProperty("reindex", true);
         }
         try {
             branch.setRoot(root.getNodeState());

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/MembershipProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/MembershipProvider.java?rev=1404084&r1=1404083&r2=1404084&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/MembershipProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/MembershipProvider.java
Wed Oct 31 10:40:57 2012
@@ -100,7 +100,7 @@ class MembershipProvider extends Authori
     @Nonnull
     Iterator<String> getMembership(Tree authorizableTree, boolean includeInherited)
{
         Set<String> groupPaths = new HashSet<String>();
-        Set<String> refPaths = identifierManager.getReferences(true, authorizableTree,
null, NT_REP_GROUP, NT_REP_MEMBERS);
+        Set<String> refPaths = identifierManager.getReferences(true, authorizableTree,
REP_MEMBERS, NT_REP_GROUP, NT_REP_MEMBERS);
         for (String propPath : refPaths) {
             int index = propPath.indexOf('/'+REP_MEMBERS);
             if (index > 0) {

Modified: jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/sql2.txt
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/sql2.txt?rev=1404084&r1=1404083&r2=1404084&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/sql2.txt
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/sql2.txt
Wed Oct 31 10:40:57 2012
@@ -121,6 +121,7 @@ select * from [nt:base] as x where isdes
 /jcr:system
 /oak:index
 /oak:index/authorizableId
+/oak:index/members
 /oak:index/primaryType
 /oak:index/principalName
 /oak:index/test-index
@@ -214,6 +215,7 @@ select * from [nt:base] where not isdesc
 /jcr:system
 /oak:index
 /oak:index/authorizableId
+/oak:index/members
 /oak:index/primaryType
 /oak:index/principalName
 /oak:index/test-index
@@ -246,6 +248,7 @@ select * from [nt:base] where not (id = 
 /jcr:system
 /oak:index
 /oak:index/authorizableId
+/oak:index/members
 /oak:index/primaryType
 /oak:index/principalName
 /oak:index/test-index
@@ -266,6 +269,7 @@ select * from [nt:base] where x is null 
 /jcr:system
 /oak:index
 /oak:index/authorizableId
+/oak:index/members
 /oak:index/primaryType
 /oak:index/principalName
 /oak:index/test-index



Mime
View raw message