directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1376493 - in /directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server: core/partition/impl/btree/AbstractBTreePartition.java xdbm/Store.java xdbm/search/impl/AllEntriesCursor.java
Date Thu, 23 Aug 2012 13:56:26 GMT
Author: elecharny
Date: Thu Aug 23 13:56:26 2012
New Revision: 1376493

URL: http://svn.apache.org/viewvc?rev=1376493&view=rev
Log:
o Exposed the MasterTable in the Store interface, so that we can use it to browse the full
table, instead of using the reverse index of entryUUID
o Removed the reverse index for the EntryCSN and EntryUUID AT
o Uses the MatserTable for the full scans in AllEntryCursor

Modified:
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java?rev=1376493&r1=1376492&r2=1376493&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
Thu Aug 23 13:56:26 2012
@@ -327,14 +327,14 @@ public abstract class AbstractBTreeParti
         if ( getEntryUuidIndex() == null )
         {
             Index<String, Entry, ID> index = createSystemIndex( SchemaConstants.ENTRY_UUID_AT_OID,
partitionPath,
-                WITH_REVERSE );
+                NO_REVERSE );
             addIndex( index );
         }
 
         if ( getEntryCsnIndex() == null )
         {
             Index<String, Entry, ID> index = createSystemIndex( SchemaConstants.ENTRY_CSN_AT_OID,
partitionPath,
-                WITH_REVERSE );
+                NO_REVERSE );
             addIndex( index );
         }
 
@@ -2717,4 +2717,13 @@ public abstract class AbstractBTreeParti
      * @throws Exception If the index can't be created
      */
     protected abstract Index createSystemIndex( String indexOid, URI path, boolean withReverse
) throws Exception;
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public MasterTable<ID, Entry> getMasterTable()
+    {
+        return master;
+    }
 }

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java?rev=1376493&r1=1376492&r2=1376493&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
Thu Aug 23 13:56:26 2012
@@ -450,4 +450,11 @@ public interface Store<E, ID extends Com
      * @return the default ID.
      */
     ID getDefaultId() throws Exception;
+
+
+    /**
+     * Expose the Master table
+     * @return The masterTable instance
+     */
+    MasterTable<ID, E> getMasterTable();
 }

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java?rev=1376493&r1=1376492&r2=1376493&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java
Thu Aug 23 13:56:26 2012
@@ -20,6 +20,7 @@
 package org.apache.directory.server.xdbm.search.impl;
 
 
+import org.apache.directory.server.core.partition.impl.btree.IndexCursorAdaptor;
 import org.apache.directory.server.xdbm.AbstractIndexCursor;
 import org.apache.directory.server.xdbm.ForwardIndexEntry;
 import org.apache.directory.server.xdbm.IndexCursor;
@@ -64,8 +65,8 @@ public class AllEntriesCursor<ID extends
     public AllEntriesCursor( Store<Entry, ID> db ) throws Exception
     {
         LOG_CURSOR.debug( "Creating AllEntriesCursor {}", this );
-        // Get a reverse cursor because we want to sort by ID
-        wrapped = db.getEntryUuidIndex().reverseCursor();
+        // Uses the MasterTable 
+        wrapped = new IndexCursorAdaptor( db.getMasterTable().cursor(), true );
     }
 
 
@@ -163,10 +164,10 @@ public class AllEntriesCursor<ID extends
         checkNotClosed( "get()" );
 
         // Create the returned IndexEntry, copying what we get from the wrapped cursor
-        IndexEntry<String, ID> wrappedEntry = wrapped.get();
-        indexEntry.setId( wrappedEntry.getId() );
-        indexEntry.setKey( wrappedEntry.getId() );
-        indexEntry.setEntry( wrappedEntry.getEntry() );
+        IndexEntry<?, ID> wrappedEntry = wrapped.get();
+        indexEntry.setId( ( ID ) wrappedEntry.getKey() );
+        indexEntry.setKey( ( ID ) wrappedEntry.getKey() );
+        indexEntry.setEntry( ( Entry ) wrappedEntry.getId() );
 
         return indexEntry;
     }



Mime
View raw message