directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r938335 - in /directory/apacheds/trunk: avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/ avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/ jdbm-store/src/main/java/org/apache/directory/se...
Date Tue, 27 Apr 2010 07:07:14 GMT
Author: seelmann
Date: Tue Apr 27 07:07:14 2010
New Revision: 938335

URL: http://svn.apache.org/viewvc?rev=938335&view=rev
Log:
Prepartion for RDN index:
o removed updnIndex from BTreePartition and Store
o removed getNdnIndex from BTreePartition


Modified:
    directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java
    directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java
    directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
    directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
    directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
    directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
    directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
    directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractXdbmPartition.java
    directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/Store.java

Modified: directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java?rev=938335&r1=938334&r2=938335&view=diff
==============================================================================
--- directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java
(original)
+++ directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java
Tue Apr 27 07:07:14 2010
@@ -145,7 +145,6 @@ public class AvlStore<E> extends Abstrac
         }
 
         ndnIdx.add( normName.getNormName(), id );
-        updnIdx.add( normName.getName(), id );
         oneLevelIdx.add( parentId, id );
 
         // Update the EntryCsn index
@@ -237,7 +236,6 @@ public class AvlStore<E> extends Abstrac
         }
 
         ndnIdx.drop( id );
-        updnIdx.drop( id );
         oneLevelIdx.drop( id );
         entryCsnIdx.drop( id );
         entryUuidIdx.drop( id );
@@ -318,7 +316,7 @@ public class AvlStore<E> extends Abstrac
      */
     public String getEntryUpdn( Long id ) throws Exception
     {
-        return updnIdx.reverseLookup( id );
+        return lookup( id ).getDn().getName();
     }
 
 
@@ -328,7 +326,7 @@ public class AvlStore<E> extends Abstrac
     public String getEntryUpdn( String dn ) throws Exception
     {
         Long id = ndnIdx.forwardLookup( dn );
-        return updnIdx.reverseLookup( id );
+        return getEntryUpdn( id );
     }
 
 
@@ -429,10 +427,6 @@ public class AvlStore<E> extends Abstrac
 
         ndnIdx.add( updn.getNormName(), id );
 
-        // update user provided DN index
-        updnIdx.drop( id );
-        updnIdx.add( updn.getName(), id );
-
         /* 
          * Read Alias Index Tuples
          * 

Modified: directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java?rev=938335&r1=938334&r2=938335&view=diff
==============================================================================
--- directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java
(original)
+++ directory/apacheds/trunk/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlStoreTest.java
Tue Apr 27 07:07:14 2010
@@ -191,10 +191,6 @@ public class AvlStoreTest
         store.setSuffixDn( EXAMPLE_COM );
         assertEquals( "dc=example,dc=com", store.getSuffixDn().getName() );
 
-        assertNull( store.getUpdnIndex() );
-        store.addIndex( new AvlIndex<String, Attributes>( ApacheSchemaConstants.APACHE_UP_DN_AT_OID
) );
-        assertNotNull( store.getUpdnIndex() );
-
         assertNotNull( store.getSuffixDn() );
 
         assertEquals( 0, store.getUserIndices().size() );
@@ -310,18 +306,9 @@ public class AvlStoreTest
         {
         }
 
-        assertNotNull( store.getUpdnIndex() );
-        try
-        {
-            store.addIndex( new AvlIndex<String, ServerEntry>( ApacheSchemaConstants.APACHE_UP_DN_AT_OID
) );
-            fail();
-        }
-        catch ( IllegalStateException e )
-        {
-        }
         Iterator<String> systemIndices = store.systemIndices();
 
-        for ( int ii = 0; ii < 11; ii++ )
+        for ( int ii = 0; ii < 10; ii++ )
         {
             assertTrue( systemIndices.hasNext() );
             assertNotNull( systemIndices.next() );

Modified: directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java?rev=938335&r1=938334&r2=938335&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
(original)
+++ directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
Tue Apr 27 07:07:14 2010
@@ -301,17 +301,6 @@ public class JdbmStore<E> extends Abstra
     /**
      * {@inheritDoc}
      */
-    public Index<String, E, Long> getUpdnIndex()
-    {
-        // FIXME this method shouldn't be supported anymore after the
-        // introduction of the RDN index, but keeping to minimise the number changes done
to interface
-        return getEntryUuidIndex();
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
     public Index<String, E, Long> getNdnIndex()
     {
         // FIXME should this be entryUuidIdx?

Modified: directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java?rev=938335&r1=938334&r2=938335&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
(original)
+++ directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
Tue Apr 27 07:07:14 2010
@@ -368,7 +368,7 @@ public class JdbmStoreTest
         
         Iterator<String> systemIndices = store.systemIndices();
 
-        for ( int ii = 0; ii < 12; ii++ )
+        for ( int ii = 0; ii < 11; ii++ )
         {
             assertTrue( systemIndices.hasNext() );
             assertNotNull( systemIndices.next() );

Modified: directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java?rev=938335&r1=938334&r2=938335&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
(original)
+++ directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
Tue Apr 27 07:07:14 2010
@@ -828,13 +828,6 @@ public class LdifPartition extends BTree
 
 
     @Override
-    public Index<String, ServerEntry, Long> getNdnIndex()
-    {
-        return wrappedPartition.getNdnIndex();
-    }
-
-
-    @Override
     public Index<Long, ServerEntry, Long> getOneAliasIndex()
     {
         return wrappedPartition.getOneAliasIndex();
@@ -905,13 +898,6 @@ public class LdifPartition extends BTree
 
 
     @Override
-    public Index<String, ServerEntry, Long> getUpdnIndex()
-    {
-        return wrappedPartition.getUpdnIndex();
-    }
-
-
-    @Override
     public Index<? extends Object, ServerEntry, Long> getUserIndex( String id ) throws
Exception
     {
         return wrappedPartition.getUserIndex( id );

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?rev=938335&r1=938334&r2=938335&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
(original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
Tue Apr 27 07:07:14 2010
@@ -364,24 +364,6 @@ public abstract class BTreePartition<ID>
 
 
     /**
-     * Gets the Index mapping user provided distinguished names of entries as 
-     * Strings to the BigInteger primary keys of entries.
-     *
-     * @return the user provided distinguished name Index
-     */
-    public abstract Index<String, ServerEntry, ID> getUpdnIndex();
-
-
-    /**
-     * Gets the Index mapping the normalized distinguished names of entries as
-     * Strings to the BigInteger primary keys of entries.  
-     *
-     * @return the normalized distinguished name Index
-     */
-    public abstract Index<String, ServerEntry, ID> getNdnIndex();
-
-
-    /**
      * Gets the alias index mapping parent entries with scope expanding aliases 
      * children one level below them; this system index is used to dereference
      * aliases on one/single level scoped searches.

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java?rev=938335&r1=938334&r2=938335&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
(original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
Tue Apr 27 07:07:14 2010
@@ -84,9 +84,6 @@ public abstract class AbstractStore<E, I
     /** the normalized distinguished name index */
     protected Index<String, E, ID> ndnIdx;
 
-    /** the user provided distinguished name index */
-    protected Index<String, E, ID> updnIdx;
-
     /** the attribute presence index */
     protected Index<String, E, ID> presenceIdx;
 
@@ -254,10 +251,6 @@ public abstract class AbstractStore<E, I
         {
             addIndex( new GenericIndex<String, E, ID>( ApacheSchemaConstants.APACHE_N_DN_AT_OID
) );
         }
-        if ( getUpdnIndex() == null )
-        {
-            addIndex( new GenericIndex<String, E, ID>( ApacheSchemaConstants.APACHE_UP_DN_AT_OID
) );
-        }
         if ( getAliasIndex() == null )
         {
             addIndex( new GenericIndex<String, E, ID>( ApacheSchemaConstants.APACHE_ALIAS_AT_OID
) );
@@ -293,7 +286,6 @@ public abstract class AbstractStore<E, I
 
         // set index shortcuts
         ndnIdx = ( Index<String, E, ID> ) systemIndices.get( ApacheSchemaConstants.APACHE_N_DN_AT_OID
);
-        updnIdx = ( Index<String, E, ID> ) systemIndices.get( ApacheSchemaConstants.APACHE_UP_DN_AT_OID
);
         presenceIdx = ( Index<String, E, ID> ) systemIndices.get( ApacheSchemaConstants.APACHE_EXISTENCE_AT_OID
);
         oneLevelIdx = ( Index<ID, E, ID> ) systemIndices.get( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID
);
         subLevelIdx = ( Index<ID, E, ID> ) systemIndices.get( ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID
);
@@ -487,16 +479,6 @@ public abstract class AbstractStore<E, I
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
-    public Index<String, E, ID> getUpdnIndex()
-    {
-        return ( Index<String, E, ID> ) systemIndices.get( ApacheSchemaConstants.APACHE_UP_DN_AT_OID
);
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    @SuppressWarnings("unchecked")
     public Index<String, E, ID> getPresenceIndex()
     {
         return ( Index<String, E, ID> ) systemIndices.get( ApacheSchemaConstants.APACHE_EXISTENCE_AT_OID
);

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractXdbmPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractXdbmPartition.java?rev=938335&r1=938334&r2=938335&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractXdbmPartition.java
(original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractXdbmPartition.java
Tue Apr 27 07:07:14 2010
@@ -151,18 +151,6 @@ public abstract class AbstractXdbmPartit
     }
 
 
-    public final Index<String, ServerEntry, ID> getUpdnIndex()
-    {
-        return store.getUpdnIndex();
-    }
-
-
-    public final Index<String, ServerEntry, ID> getNdnIndex()
-    {
-        return store.getNdnIndex();
-    }
-
-
     public final Iterator<String> getUserIndices()
     {
         return store.userIndices();

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/Store.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/Store.java?rev=938335&r1=938334&r2=938335&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/Store.java
(original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/Store.java
Tue Apr 27 07:07:14 2010
@@ -101,8 +101,6 @@ public interface Store<E, ID>
 
         ApacheSchemaConstants.APACHE_N_DN_AT_OID,
 
-        ApacheSchemaConstants.APACHE_UP_DN_AT_OID,
-
         ApacheSchemaConstants.APACHE_ALIAS_AT_OID,
 
         ApacheSchemaConstants.APACHE_ONE_ALIAS_AT_OID,
@@ -289,12 +287,6 @@ public interface Store<E, ID>
 
 
     /**
-     * @return The UpDN system index
-     */
-    Index<String, E, ID> getUpdnIndex();
-
-
-    /**
      * @return The Ndn system index
      */
     Index<String, E, ID> getNdnIndex();



Mime
View raw message