jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1163117 - /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
Date Tue, 30 Aug 2011 07:32:36 GMT
Author: thomasm
Date: Tue Aug 30 07:32:35 2011
New Revision: 1163117

URL: http://svn.apache.org/viewvc?rev=1163117&view=rev
Log:
Index mechanism (WIP)

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java?rev=1163117&r1=1163116&r2=1163117&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
Tue Aug 30 07:32:35 2011
@@ -21,8 +21,8 @@ package org.apache.jackrabbit.spi2microk
 import org.apache.commons.io.IOUtils;
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.api.MicroKernelException;
-import org.apache.jackrabbit.mk.index.Index;
 import org.apache.jackrabbit.mk.index.Indexer;
+import org.apache.jackrabbit.mk.index.PropertyIndex;
 import org.apache.jackrabbit.mk.json.JsonBuilder;
 import org.apache.jackrabbit.mk.util.PathUtils;
 import org.apache.jackrabbit.spi.Batch;
@@ -176,7 +176,7 @@ public class RepositoryServiceImpl exten
 
     private final MicroKernel microKernel;
     private final Indexer indexer;
-    private final Index jcrUuidIndex;
+    private final PropertyIndex jcrUuidIndex;
     private final Map<SessionInfo, SessionState> sessions = new ConcurrentHashMap<SessionInfo,
SessionState>();
     private final NodeTypeStore nodeTypeStore;
     private final String defaultWorkspace;
@@ -204,7 +204,7 @@ public class RepositoryServiceImpl exten
             }
 
             indexer = new Indexer(microKernel, systemWorkspace);
-            jcrUuidIndex = indexer.createUniqueIndex("{jcr}uuid");
+            jcrUuidIndex = indexer.createPropertyIndex("{jcr}uuid", true);
         }
         catch (MicroKernelException e) {
             throw new RepositoryException(e.getMessage(), e);
@@ -547,8 +547,10 @@ public class RepositoryServiceImpl exten
         int childHash = childName == null ? 0 : childName.hashCode();
         String id = Integer.toHexString(nodeHash + childHash);
 
+        String rev = microKernel.getHeadRevision();
         // rehash while id is not unique
-        while (jcrUuidIndex.findFirst(id).hasNext()) {
+        // TODO review this algorithm, it looks dangerous
+        while (jcrUuidIndex.getPath(id, rev) != null) {
             id = Integer.toHexString(id.hashCode());
         }
 



Mime
View raw message