You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ka...@apache.org on 2013/07/25 16:40:10 UTC

svn commit: r1506991 - /directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotIndex.java

Author: kayyagari
Date: Thu Jul 25 14:40:09 2013
New Revision: 1506991

URL: http://svn.apache.org/r1506991
Log:
disable duplicate support for entryCSN and entryUUID indices

Modified:
    directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotIndex.java

Modified: directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotIndex.java?rev=1506991&r1=1506990&r2=1506991&view=diff
==============================================================================
--- directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotIndex.java (original)
+++ directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotIndex.java Thu Jul 25 14:40:09 2013
@@ -25,6 +25,7 @@ import java.io.FileWriter;
 import java.io.IOException;
 import java.net.URI;
 
+import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.cursor.Cursor;
 import org.apache.directory.api.ldap.model.cursor.EmptyCursor;
 import org.apache.directory.api.ldap.model.cursor.Tuple;
@@ -174,9 +175,18 @@ public class MavibotIndex<K, V> extends 
             forwardKeySerializer = ( ElementSerializer<K> ) new StringSerializer( comp );
         }
 
+        boolean forwardDups = true;
+        
+        String oid = attributeType.getOid();
+        // disable duplicates for entryCSN and entryUUID attribute indices
+        if( oid.equals( SchemaConstants.ENTRY_CSN_AT_OID ) || oid.equals( SchemaConstants.ENTRY_UUID_AT_OID ) )
+        {
+            forwardDups = false;
+        }
+        
         String forwardTableName = attributeType.getOid() + FORWARD_BTREE;
         forward = new MavibotTable<K, String>( recordMan, schemaManager, forwardTableName, forwardKeySerializer,
-            new StringSerializer(), true );
+            new StringSerializer(), forwardDups );
 
         /*
          * Now the reverse map stores the primary key into the master table as