You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2012/09/17 12:53:40 UTC

svn commit: r1386549 - in /directory/apacheds/branches/apacheds-mvbt: jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ server-config/src/main/resources/ server-integ/src/test/java/org/apache/directory/server/oper...

Author: elecharny
Date: Mon Sep 17 10:53:39 2012
New Revision: 1386549

URL: http://svn.apache.org/viewvc?rev=1386549&view=rev
Log:
Removed the useless entryUuid index

Modified:
    directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
    directory/apacheds/branches/apacheds-mvbt/server-config/src/main/resources/config.ldif
    directory/apacheds/branches/apacheds-mvbt/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchPerfIT.java
    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/cursor/AllEntriesCursor.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ApproximateCursor.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/EqualityCursor.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/GreaterEqCursor.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/LessEqCursor.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/NotCursor.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/PresenceCursor.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubstringCursor.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/PresenceEvaluator.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/PartitionTest.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java

Modified: directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java?rev=1386549&r1=1386548&r2=1386549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java Mon Sep 17 10:53:39 2012
@@ -333,8 +333,6 @@ public class JdbmStoreTest
         {
         }
 
-        assertNotNull( store.getEntryUuidIndex() );
-
         assertNotNull( store.getRdnIndex() );
         try
         {
@@ -377,7 +375,7 @@ public class JdbmStoreTest
 
         Iterator<String> systemIndices = store.getSystemIndices();
 
-        for ( int ii = 0; ii < 8; ii++ )
+        for ( int i = 0; i < 7; i++ )
         {
             assertTrue( systemIndices.hasNext() );
             assertNotNull( systemIndices.next() );
@@ -767,22 +765,17 @@ public class JdbmStoreTest
         File ouIndexDbFile = new File( wkdir, SchemaConstants.OU_AT_OID + ".db" );
         File ouIndexTxtFile = new File( wkdir, SchemaConstants.OU_AT_OID + "-ou.txt" );
         File uuidIndexDbFile = new File( wkdir, SchemaConstants.ENTRY_UUID_AT_OID + ".db" );
-        File uuidIndexTxtFile = new File( wkdir, SchemaConstants.ENTRY_UUID_AT_OID + "-entryUUID.txt" );
 
         assertTrue( ouIndexDbFile.exists() );
         assertTrue( ouIndexTxtFile.exists() );
-        assertTrue( uuidIndexDbFile.exists() );
-        assertTrue( uuidIndexTxtFile.exists() );
 
         // destroy the store to manually start the init phase
         // by keeping the same work dir
         store.destroy();
 
-        // just assert again that ou and entryUUID files exist even after destroying the store
+        // just assert again that ou files exist even after destroying the store
         assertTrue( ouIndexDbFile.exists() );
         assertTrue( ouIndexTxtFile.exists() );
-        assertTrue( uuidIndexDbFile.exists() );
-        assertTrue( uuidIndexTxtFile.exists() );
 
         store = new JdbmPartition( schemaManager );
         store.setId( "example" );
@@ -799,8 +792,5 @@ public class JdbmStoreTest
 
         assertFalse( ouIndexDbFile.exists() );
         assertFalse( ouIndexTxtFile.exists() );
-
-        assertTrue( uuidIndexDbFile.exists() );
-        assertTrue( uuidIndexTxtFile.exists() );
     }
 }

Modified: directory/apacheds/branches/apacheds-mvbt/server-config/src/main/resources/config.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/server-config/src/main/resources/config.ldif?rev=1386549&r1=1386548&r2=1386549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/server-config/src/main/resources/config.ldif (original)
+++ directory/apacheds/branches/apacheds-mvbt/server-config/src/main/resources/config.ldif Mon Sep 17 10:53:39 2012
@@ -270,7 +270,6 @@ ads-indexes: apacheOneAlias
 ads-indexes: apacheSubAlias
 ads-indexes: apacheAlias
 ads-indexes: objectClass
-ads-indexes: entryUUID
 ads-indexes: entryCSN
 ads-indexes: ou
 ads-indexes: uid
@@ -351,16 +350,6 @@ objectclass: ads-base
 objectclass: top
 ads-enabled: TRUE
 
-dn: ads-indexAttributeId=entryUUID,ou=indexes,ads-partitionId=system,ou=partitions,ads-directoryServiceId=default,ou=config
-ads-indexattributeid: entryUUID
-ads-indexHasReverse: TRUE
-ads-indexcachesize: 100
-objectclass: ads-index
-objectclass: ads-jdbmIndex
-objectclass: ads-base
-objectclass: top
-ads-enabled: TRUE
-
 dn: ads-indexAttributeId=entryCSN,ou=indexes,ads-partitionId=system,ou=partitions,ads-directoryServiceId=default,ou=config
 ads-indexattributeid: entryCSN
 ads-indexHasReverse: FALSE
@@ -403,7 +392,6 @@ ads-indexes: apacheOneLevel
 ads-indexes: apacheOneAlias
 ads-indexes: apacheSubAlias
 ads-indexes: apacheAlias
-ads-indexes: entryUUID
 ads-indexes: entryCSN
 ads-indexes: dc
 ads-indexes: krb5PrincipalName
@@ -502,16 +490,6 @@ objectclass: ads-base
 objectclass: top
 ads-enabled: TRUE
 
-dn: ads-indexAttributeId=entryUUID,ou=indexes,ads-partitionId=example,ou=partitions,ads-directoryServiceId=default,ou=config
-ads-indexattributeid: entryUUID
-ads-indexHasReverse: TRUE
-ads-indexcachesize: 100
-objectclass: ads-index
-objectclass: ads-jdbmIndex
-objectclass: ads-base
-objectclass: top
-ads-enabled: TRUE
-
 dn: ads-indexAttributeId=entryCSN,ou=indexes,ads-partitionId=example,ou=partitions,ads-directoryServiceId=default,ou=config
 ads-indexattributeid: entryCSN
 ads-indexHasReverse: FALSE

Modified: directory/apacheds/branches/apacheds-mvbt/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchPerfIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchPerfIT.java?rev=1386549&r1=1386548&r2=1386549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchPerfIT.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchPerfIT.java Mon Sep 17 10:53:39 2012
@@ -58,6 +58,7 @@ public class SearchPerfIT extends Abstra
     @Rule
     public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
 
+
     /**
      * test a search request perf.
      */
@@ -118,11 +119,11 @@ public class SearchPerfIT extends Abstra
                 if ( j % 10000 == 0 )
                 {
                     long tt1 = System.currentTimeMillis();
-                    
+
                     System.out.println( j + ", " + ( tt1 - tt0 ) );
                     tt0 = tt1;
                 }
-                
+
                 if ( j == 50000 )
                 {
                     t00 = System.currentTimeMillis();
@@ -134,7 +135,7 @@ public class SearchPerfIT extends Abstra
                 {
                     cursor.get();
                 }
-                
+
                 cursor.close();
             }
 
@@ -218,11 +219,11 @@ public class SearchPerfIT extends Abstra
                 if ( j % 10000 == 0 )
                 {
                     long tt1 = System.currentTimeMillis();
-                    
+
                     System.out.println( j + ", " + ( tt1 - tt0 ) );
                     tt0 = tt1;
                 }
-                
+
                 if ( j == 50000 )
                 {
                     t00 = System.currentTimeMillis();
@@ -234,7 +235,7 @@ public class SearchPerfIT extends Abstra
                 {
                     cursor.get();
                 }
-                
+
                 cursor.close();
             }
 
@@ -242,6 +243,7 @@ public class SearchPerfIT extends Abstra
 
             Long deltaWarmed = ( t1 - t00 );
             System.out.println( "Delta : " + deltaWarmed + "( " + ( ( ( nbIterations - 50000 ) * 1000 ) / deltaWarmed )
+                * 5
                 + " per s ) /" + ( t1 - t0 ) );
         }
         catch ( LdapException e )
@@ -319,11 +321,11 @@ public class SearchPerfIT extends Abstra
                 if ( j % 10000 == 0 )
                 {
                     long tt1 = System.currentTimeMillis();
-                    
+
                     System.out.println( j + ", " + ( tt1 - tt0 ) );
                     tt0 = tt1;
                 }
-                
+
                 if ( j == 50000 )
                 {
                     t00 = System.currentTimeMillis();
@@ -335,7 +337,7 @@ public class SearchPerfIT extends Abstra
                 {
                     cursor.get();
                 }
-                
+
                 cursor.close();
             }
 
@@ -343,6 +345,7 @@ public class SearchPerfIT extends Abstra
 
             Long deltaWarmed = ( t1 - t00 );
             System.out.println( "Delta : " + deltaWarmed + "( " + ( ( ( nbIterations - 50000 ) * 1000 ) / deltaWarmed )
+                * 10
                 + " per s ) /" + ( t1 - t0 ) );
         }
         catch ( LdapException e )

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=1386549&r1=1386548&r2=1386549&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 Mon Sep 17 10:53:39 2012
@@ -145,9 +145,6 @@ public abstract class AbstractBTreeParti
     /** the attribute presence index */
     protected Index<String, Entry, String> presenceIdx;
 
-    /** a system index on entryUUID attribute */
-    protected Index<String, Entry, String> entryUuidIdx;
-
     /** a system index on entryCSN attribute */
     protected Index<String, Entry, String> entryCsnIdx;
 
@@ -323,13 +320,6 @@ public abstract class AbstractBTreeParti
             addIndex( index );
         }
 
-        if ( getEntryUuidIndex() == null )
-        {
-            Index<String, Entry, String> index = createSystemIndex( SchemaConstants.ENTRY_UUID_AT_OID, partitionPath,
-                NO_REVERSE );
-            addIndex( index );
-        }
-
         if ( getEntryCsnIndex() == null )
         {
             Index<String, Entry, String> index = createSystemIndex( SchemaConstants.ENTRY_CSN_AT_OID, partitionPath,
@@ -355,7 +345,6 @@ public abstract class AbstractBTreeParti
         subAliasIdx = ( Index<String, Entry, String> ) systemIndices
             .get( ApacheSchemaConstants.APACHE_SUB_ALIAS_AT_OID );
         objectClassIdx = ( Index<String, Entry, String> ) systemIndices.get( SchemaConstants.OBJECT_CLASS_AT_OID );
-        entryUuidIdx = ( Index<String, Entry, String> ) systemIndices.get( SchemaConstants.ENTRY_UUID_AT_OID );
         entryCsnIdx = ( Index<String, Entry, String> ) systemIndices.get( SchemaConstants.ENTRY_CSN_AT_OID );
     }
 
@@ -693,17 +682,6 @@ public abstract class AbstractBTreeParti
 
             entryCsnIdx.add( entryCsn.getString(), id );
 
-            // Update the EntryUuid index
-            Attribute entryUuid = entry.get( ENTRY_UUID_AT );
-
-            if ( entryUuid == null )
-            {
-                String msg = I18n.err( I18n.ERR_220, entryDn.getName(), entry );
-                throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, msg );
-            }
-
-            entryUuidIdx.add( entryUuid.getString(), id );
-
             // Now work on the user defined userIndices
             for ( Attribute attribute : entry )
             {
@@ -864,13 +842,12 @@ public abstract class AbstractBTreeParti
             ParentIdAndRdn parent = rdnIdx.reverseLookup( id );
             updateRdnIdx( parent.getParentId(), REMOVE_CHILD, 0 );
 
-            // Update the rdn, oneLevel, subLevel, entryCsn and entryUuid indexes
+            // Update the rdn, oneLevel, subLevel, and entryCsn indexes
             rdnIdx.drop( id );
 
             dumpRdnIdx();
 
             entryCsnIdx.drop( entry.get( ENTRY_CSN_AT ).getString(), id );
-            entryUuidIdx.drop( entry.get( ENTRY_UUID_AT ).getString(), id );
 
             // Update the user indexes
             for ( Attribute attribute : entry )
@@ -2381,16 +2358,6 @@ public abstract class AbstractBTreeParti
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
-    public Index<String, Entry, String> getEntryUuidIndex()
-    {
-        return ( Index<String, Entry, String> ) systemIndices.get( SchemaConstants.ENTRY_UUID_AT_OID );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    @SuppressWarnings("unchecked")
     public Index<String, Entry, String> getEntryCsnIndex()
     {
         return ( Index<String, Entry, String> ) systemIndices.get( SchemaConstants.ENTRY_CSN_AT_OID );

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=1386549&r1=1386548&r2=1386549&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 Mon Sep 17 10:53:39 2012
@@ -201,12 +201,6 @@ public interface Store
 
 
     /**
-     * @return The EntryUUID system index
-     */
-    Index<String, Entry, String> getEntryUuidIndex();
-
-
-    /**
      * @return The EntryCSN system index
      */
     Index<String, Entry, String> getEntryCsnIndex();

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AllEntriesCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AllEntriesCursor.java?rev=1386549&r1=1386548&r2=1386549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AllEntriesCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AllEntriesCursor.java Mon Sep 17 10:53:39 2012
@@ -42,7 +42,7 @@ public class AllEntriesCursor extends Ab
     /** The index entry we use to return entries one by one.  */
     private IndexEntry<String, String> indexEntry = new IndexEntry<String, String>();
 
-    /** The cursor on the EntryUUID index */
+    /** The cursor on the MsterTable index */
     private final Cursor<IndexEntry<String, String>> wrapped;
 
 
@@ -57,14 +57,14 @@ public class AllEntriesCursor extends Ab
 
     /**
      * Creates a new instance of AllEntriesCursor
-     * @param db
+     * @param store
      * @throws Exception
      */
-    public AllEntriesCursor( Store db ) throws Exception
+    public AllEntriesCursor( Store store ) throws Exception
     {
         LOG_CURSOR.debug( "Creating AllEntriesCursor {}", this );
         // Uses the MasterTable 
-        wrapped = new IndexCursorAdaptor( db.getMasterTable().cursor(), true );
+        wrapped = new IndexCursorAdaptor( store.getMasterTable().cursor(), true );
     }
 
 
@@ -136,6 +136,8 @@ public class AllEntriesCursor extends Ab
         checkNotClosed( "get()" );
 
         // Create the returned IndexEntry, copying what we get from the wrapped cursor
+        // As we are using the MasterTable, we have to use the key as the 
+        // ID and value
         IndexEntry<?, String> wrappedEntry = wrapped.get();
         indexEntry.setId( ( String ) wrappedEntry.getKey() );
         indexEntry.setKey( ( String ) wrappedEntry.getKey() );

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ApproximateCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ApproximateCursor.java?rev=1386549&r1=1386548&r2=1386549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ApproximateCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ApproximateCursor.java Mon Sep 17 10:53:39 2012
@@ -66,12 +66,12 @@ public class ApproximateCursor<V> extend
 
     /**
      * Creates a new instance of ApproximateCursor
-     * @param db The Store we want to build a cursor on
+     * @param store The Store we want to build a cursor on
      * @param approximateEvaluator The evaluator
      * @throws Exception If the creation failed
      */
     @SuppressWarnings("unchecked")
-    public ApproximateCursor( Store db, ApproximateEvaluator<V> approximateEvaluator ) throws Exception
+    public ApproximateCursor( Store store, ApproximateEvaluator<V> approximateEvaluator ) throws Exception
     {
         LOG_CURSOR.debug( "Creating ApproximateCursor {}", this );
         this.approximateEvaluator = approximateEvaluator;
@@ -79,15 +79,15 @@ public class ApproximateCursor<V> extend
         AttributeType attributeType = approximateEvaluator.getExpression().getAttributeType();
         Value<V> value = approximateEvaluator.getExpression().getValue();
 
-        if ( db.hasIndexOn( attributeType ) )
+        if ( store.hasIndexOn( attributeType ) )
         {
-            Index<V, Entry, String> index = ( Index<V, Entry, String> ) db.getIndex( attributeType );
+            Index<V, Entry, String> index = ( Index<V, Entry, String> ) store.getIndex( attributeType );
             userIdxCursor = index.forwardCursor( value.getValue() );
             uuidIdxCursor = null;
         }
         else
         {
-            uuidIdxCursor = db.getEntryUuidIndex().forwardCursor();
+            uuidIdxCursor = new AllEntriesCursor( store );
             userIdxCursor = null;
         }
     }

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/EqualityCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/EqualityCursor.java?rev=1386549&r1=1386548&r2=1386549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/EqualityCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/EqualityCursor.java Mon Sep 17 10:53:39 2012
@@ -64,12 +64,12 @@ public class EqualityCursor<V> extends A
 
     /**
      * Creates a new instance of an EqualityCursor
-     * @param db The store
+     * @param store The store
      * @param equalityEvaluator The EqualityEvaluator
      * @throws Exception If the creation failed
      */
     @SuppressWarnings("unchecked")
-    public EqualityCursor( Store db, EqualityEvaluator<V> equalityEvaluator ) throws Exception
+    public EqualityCursor( Store store, EqualityEvaluator<V> equalityEvaluator ) throws Exception
     {
         LOG_CURSOR.debug( "Creating EqualityCursor {}", this );
         this.equalityEvaluator = equalityEvaluator;
@@ -77,15 +77,15 @@ public class EqualityCursor<V> extends A
         AttributeType attributeType = equalityEvaluator.getExpression().getAttributeType();
         Value<V> value = equalityEvaluator.getExpression().getValue();
 
-        if ( db.hasIndexOn( attributeType ) )
+        if ( store.hasIndexOn( attributeType ) )
         {
-            Index<V, Entry, String> userIndex = ( Index<V, Entry, String> ) db.getIndex( attributeType );
+            Index<V, Entry, String> userIndex = ( Index<V, Entry, String> ) store.getIndex( attributeType );
             userIdxCursor = userIndex.forwardCursor( value.getValue() );
             uuidIdxCursor = null;
         }
         else
         {
-            uuidIdxCursor = db.getEntryUuidIndex().forwardCursor();
+            uuidIdxCursor = new AllEntriesCursor( store );
             userIdxCursor = null;
         }
     }

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/GreaterEqCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/GreaterEqCursor.java?rev=1386549&r1=1386548&r2=1386549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/GreaterEqCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/GreaterEqCursor.java Mon Sep 17 10:53:39 2012
@@ -69,26 +69,26 @@ public class GreaterEqCursor<V> extends 
 
     /**
      * Creates a new instance of an GreaterEqCursor
-     * @param db The store
+     * @param store The store
      * @param equalityEvaluator The GreaterEqEvaluator
      * @throws Exception If the creation failed
      */
     @SuppressWarnings("unchecked")
-    public GreaterEqCursor( Store db, GreaterEqEvaluator<V> greaterEqEvaluator ) throws Exception
+    public GreaterEqCursor( Store store, GreaterEqEvaluator<V> greaterEqEvaluator ) throws Exception
     {
         LOG_CURSOR.debug( "Creating GreaterEqCursor {}", this );
         this.greaterEqEvaluator = greaterEqEvaluator;
 
         AttributeType attributeType = greaterEqEvaluator.getExpression().getAttributeType();
 
-        if ( db.hasIndexOn( attributeType ) )
+        if ( store.hasIndexOn( attributeType ) )
         {
-            userIdxCursor = ( ( Index<V, Entry, String> ) db.getIndex( attributeType ) ).forwardCursor();
+            userIdxCursor = ( ( Index<V, Entry, String> ) store.getIndex( attributeType ) ).forwardCursor();
             uuidIdxCursor = null;
         }
         else
         {
-            uuidIdxCursor = db.getEntryUuidIndex().forwardCursor();
+            uuidIdxCursor = new AllEntriesCursor( store );
             userIdxCursor = null;
         }
     }

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/LessEqCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/LessEqCursor.java?rev=1386549&r1=1386548&r2=1386549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/LessEqCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/LessEqCursor.java Mon Sep 17 10:53:39 2012
@@ -57,32 +57,32 @@ public class LessEqCursor<V> extends Abs
     private final Cursor<IndexEntry<V, String>> userIdxCursor;
 
     /** NDN Cursor on all entries in  (set when no index on user attribute) */
-    private final Cursor<IndexEntry<V, String>> uuidIdxCursor;
+    private final Cursor<IndexEntry<String, String>> uuidIdxCursor;
 
     /**
      * Used to store indexEntry from uudCandidate so it can be saved after
      * call to evaluate() which changes the value so it's not referring to
      * the String but to the value of the attribute instead.
      */
-    private IndexEntry<V, String> uuidCandidate;
+    private IndexEntry<String, String> uuidCandidate;
 
 
     @SuppressWarnings("unchecked")
-    public LessEqCursor( Store db, LessEqEvaluator<V> lessEqEvaluator ) throws Exception
+    public LessEqCursor( Store store, LessEqEvaluator<V> lessEqEvaluator ) throws Exception
     {
         LOG_CURSOR.debug( "Creating LessEqCursor {}", this );
         this.lessEqEvaluator = lessEqEvaluator;
 
         AttributeType attributeType = lessEqEvaluator.getExpression().getAttributeType();
 
-        if ( db.hasIndexOn( attributeType ) )
+        if ( store.hasIndexOn( attributeType ) )
         {
-            userIdxCursor = ( ( Index<V, Entry, String> ) db.getIndex( attributeType ) ).forwardCursor();
+            userIdxCursor = ( ( Index<V, Entry, String> ) store.getIndex( attributeType ) ).forwardCursor();
             uuidIdxCursor = null;
         }
         else
         {
-            uuidIdxCursor = ( Cursor ) db.getEntryUuidIndex().forwardCursor();
+            uuidIdxCursor = new AllEntriesCursor( store );
             userIdxCursor = null;
         }
     }
@@ -254,6 +254,7 @@ public class LessEqCursor<V> extends Abs
         {
             checkNotClosed( "previous()" );
             uuidCandidate = uuidIdxCursor.get();
+
             if ( lessEqEvaluator.evaluate( uuidCandidate ) )
             {
                 return setAvailable( true );
@@ -330,7 +331,7 @@ public class LessEqCursor<V> extends Abs
 
         if ( available() )
         {
-            return uuidCandidate;
+            return ( IndexEntry<V, String> ) uuidCandidate;
         }
 
         throw new InvalidCursorPositionException( I18n.err( I18n.ERR_708 ) );

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/NotCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/NotCursor.java?rev=1386549&r1=1386548&r2=1386549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/NotCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/NotCursor.java Mon Sep 17 10:53:39 2012
@@ -25,7 +25,6 @@ import org.apache.directory.server.xdbm.
 import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.search.Evaluator;
-import org.apache.directory.shared.ldap.model.cursor.Cursor;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.filter.ExprNode;
 import org.slf4j.Logger;
@@ -43,7 +42,7 @@ public class NotCursor<V> extends Abstra
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_718 );
-    private final Cursor<IndexEntry<V, String>> uuidCursor;
+    private final AllEntriesCursor uuidCursor;
     private final Evaluator<? extends ExprNode> childEvaluator;
 
 
@@ -53,7 +52,8 @@ public class NotCursor<V> extends Abstra
     {
         LOG_CURSOR.debug( "Creating NotCursor {}", this );
         this.childEvaluator = childEvaluator;
-        this.uuidCursor = ( Cursor ) store.getEntryUuidIndex().forwardCursor();
+        this.uuidCursor = new AllEntriesCursor( store );
+
     }
 
 
@@ -138,7 +138,7 @@ public class NotCursor<V> extends Abstra
 
         if ( available() )
         {
-            return uuidCursor.get();
+            return ( IndexEntry<V, String> ) uuidCursor.get();
         }
 
         throw new InvalidCursorPositionException( I18n.err( I18n.ERR_708 ) );

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/PresenceCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/PresenceCursor.java?rev=1386549&r1=1386548&r2=1386549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/PresenceCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/PresenceCursor.java Mon Sep 17 10:53:39 2012
@@ -57,7 +57,7 @@ public class PresenceCursor extends Abst
         this.presenceEvaluator = presenceEvaluator;
         AttributeType type = presenceEvaluator.getAttributeType();
 
-        // we don't maintain a presence index for objectClass, entryUUID, and entryCSN
+        // we don't maintain a presence index for objectClass, and entryCSN
         // as it doesn't make sense because every entry has such an attribute
         // instead for those attributes and all un-indexed attributes we use the ndn index
         if ( store.hasUserIndexOn( type ) )
@@ -68,7 +68,7 @@ public class PresenceCursor extends Abst
         else
         {
             presenceCursor = null;
-            uuidCursor = store.getEntryUuidIndex().forwardCursor();
+            uuidCursor = new AllEntriesCursor( store );
         }
     }
 

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubstringCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubstringCursor.java?rev=1386549&r1=1386548&r2=1386549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubstringCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubstringCursor.java Mon Sep 17 10:53:39 2012
@@ -76,7 +76,7 @@ public class SubstringCursor extends Abs
              * knows to use it, when it itself detects the lack of an index on
              * the node's attribute.
              */
-            wrapped = store.getEntryUuidIndex().forwardCursor();
+            wrapped = new AllEntriesCursor( store );
         }
     }
 

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/PresenceEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/PresenceEvaluator.java?rev=1386549&r1=1386548&r2=1386549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/PresenceEvaluator.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/PresenceEvaluator.java Mon Sep 17 10:53:39 2012
@@ -26,6 +26,7 @@ import org.apache.directory.server.xdbm.
 import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.search.Evaluator;
+import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.entry.Attribute;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.filter.PresenceNode;
@@ -109,9 +110,10 @@ public class PresenceEvaluator implement
     // wrapper or the raw normalized value
     public boolean evaluate( Entry entry ) throws Exception
     {
-        if ( db.hasSystemIndexOn( attributeType ) )
+        if ( db.hasSystemIndexOn( attributeType )
+            || ( attributeType.getOid().equals( SchemaConstants.ENTRY_UUID_AT_OID ) ) )
         {
-            // we don't maintain a presence index for objectClass, entryUUID, and entryCSN
+            // we don't maintain a presence index for objectClass, entryUUID and entryCSN
             // however as every entry has such an attribute this evaluator always evaluates to true
             return true;
         }

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java?rev=1386549&r1=1386548&r2=1386549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java Mon Sep 17 10:53:39 2012
@@ -27,6 +27,7 @@ import org.apache.directory.server.i18n.
 import org.apache.directory.server.xdbm.Index;
 import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.search.Optimizer;
+import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.filter.AndNode;
 import org.apache.directory.shared.ldap.model.filter.ApproximateNode;
@@ -355,9 +356,10 @@ public class DefaultOptimizer<E> impleme
             Index<String, Entry, String> idx = db.getPresenceIndex();
             return idx.count( node.getAttributeType().getOid() );
         }
-        else if ( db.hasSystemIndexOn( node.getAttributeType() ) )
+        else if ( db.hasSystemIndexOn( node.getAttributeType() )
+            || ( node.getAttributeType().getOid() == SchemaConstants.ENTRY_UUID_AT_OID ) )
         {
-            // the system indices (objectClass, entryUUID, entryCSN) are maintained for
+            // the system indices (objectClass, entryUUID and entryCSN) are maintained for
             // each entry, so we could just return the database count
             return db.count();
         }

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/PartitionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/PartitionTest.java?rev=1386549&r1=1386548&r2=1386549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/PartitionTest.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/PartitionTest.java Mon Sep 17 10:53:39 2012
@@ -154,7 +154,6 @@ public class PartitionTest
         assertEquals( 15, partition.getPresenceIndex().count() );
         assertEquals( 27, partition.getObjectClassIndex().count() );
         assertEquals( 11, partition.getEntryCsnIndex().count() );
-        assertEquals( 11, partition.getEntryUuidIndex().count() );
 
         Iterator<String> userIndices = partition.getUserIndices();
         int count = 0;

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java?rev=1386549&r1=1386548&r2=1386549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java Mon Sep 17 10:53:39 2012
@@ -249,7 +249,6 @@ public class AvlPartitionTest
         {
         }
 
-        assertNotNull( partition.getEntryUuidIndex() );
         assertNotNull( partition.getRdnIndex() );
 
         try
@@ -287,7 +286,7 @@ public class AvlPartitionTest
 
         Iterator<String> systemIndices = partition.getSystemIndices();
 
-        for ( int i = 0; i < 8; i++ )
+        for ( int i = 0; i < 7; i++ )
         {
             assertTrue( systemIndices.hasNext() );
             assertNotNull( systemIndices.next() );