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 2011/07/01 10:42:23 UTC
svn commit: r1141871 - in
/directory/apacheds/branches/apacheds-no-reverse-index:
jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/
xdbm-partition/src/main/java/org/apache/directory/server/xdbm/
Author: elecharny
Date: Fri Jul 1 08:42:23 2011
New Revision: 1141871
URL: http://svn.apache.org/viewvc?rev=1141871&view=rev
Log:
o Fixed a test (catching the correct exception)
o Fixed the way we handled the subLevel index : we were injecting too many IDs into it
Modified:
directory/apacheds/branches/apacheds-no-reverse-index/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
Modified: directory/apacheds/branches/apacheds-no-reverse-index/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-no-reverse-index/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java?rev=1141871&r1=1141870&r2=1141871&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-no-reverse-index/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java (original)
+++ directory/apacheds/branches/apacheds-no-reverse-index/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java Fri Jul 1 08:42:23 2011
@@ -53,6 +53,7 @@ import org.apache.directory.shared.ldap.
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.apache.directory.shared.ldap.model.entry.Modification;
import org.apache.directory.shared.ldap.model.entry.ModificationOperation;
+import org.apache.directory.shared.ldap.model.exception.LdapContextNotEmptyException;
import org.apache.directory.shared.ldap.model.exception.LdapNoSuchObjectException;
import org.apache.directory.shared.ldap.model.exception.LdapSchemaViolationException;
import org.apache.directory.shared.ldap.model.name.Dn;
@@ -477,7 +478,7 @@ public class JdbmStoreTest
}
- @Test
+ @Test( expected=LdapContextNotEmptyException.class )
public void testFreshStore() throws Exception
{
Dn dn = new Dn( schemaManager, "o=Good Times Co." );
Modified: directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java?rev=1141871&r1=1141870&r2=1141871&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java (original)
+++ directory/apacheds/branches/apacheds-no-reverse-index/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java Fri Jul 1 08:42:23 2011
@@ -942,6 +942,13 @@ public abstract class AbstractStore<E, I
// Compute some IDs now
ID rootId = getRootId();
List<ID> parentIds = getParentIds( entryDn );
+
+ ID contextEntryId = rootId;
+
+ if ( parentIds.size() > 1 )
+ {
+ contextEntryId = parentIds.get( 1 );
+ }
// First, get the ParentId and create the key to be added in the rdnIdx
if ( entryDn.equals( suffixDn ) )
@@ -996,21 +1003,24 @@ public abstract class AbstractStore<E, I
// The oneLevel index
oneLevelIdx.add( parentId, newId );
- // The subLevel index : we must link all the hierarchy to the added entry
+ // The subLevel index : we must link all the hierarchy to the added entry.
+ //
for ( ID id : parentIds )
{
- if ( id.equals( rootId ) )
+ if ( id.equals( rootId ) || id.equals( contextEntryId ) )
{
- // Skip the rootDSE
+ // Skip the rootDSE and the context entry
continue;
}
// Add the <ancestor, newId> tuple
subLevelIdx.add( id, newId );
+ //System.out.println( "Adding <" + id + ", " + newId + ">" );
}
// making entry an ancestor/descendent of itself in sublevel index
subLevelIdx.add( newId, newId );
+ //System.out.println( "Adding self <" + newId + ", " + newId + ">" );
// The entryCSN index
Attribute entryCsn = entry.get( ENTRY_CSN_AT );