directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1309620 - in /directory/apacheds/branches/index-work: core-constants/src/main/java/org/apache/directory/server/constants/ jdbm-partition/ jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ xdbm-partiti...
Date Wed, 04 Apr 2012 23:06:07 GMT
Author: elecharny
Date: Wed Apr  4 23:06:06 2012
New Revision: 1309620

URL: http://svn.apache.org/viewvc?rev=1309620&view=rev
Log:
Complete removal of the OneLevel index from the server

Modified:
    directory/apacheds/branches/index-work/core-constants/src/main/java/org/apache/directory/server/constants/ApacheSchemaConstants.java
    directory/apacheds/branches/index-work/jdbm-partition/pom.xml
    directory/apacheds/branches/index-work/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
    directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
    directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/PartitionTest.java
    directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java

Modified: directory/apacheds/branches/index-work/core-constants/src/main/java/org/apache/directory/server/constants/ApacheSchemaConstants.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-constants/src/main/java/org/apache/directory/server/constants/ApacheSchemaConstants.java?rev=1309620&r1=1309619&r2=1309620&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-constants/src/main/java/org/apache/directory/server/constants/ApacheSchemaConstants.java
(original)
+++ directory/apacheds/branches/index-work/core-constants/src/main/java/org/apache/directory/server/constants/ApacheSchemaConstants.java
Wed Apr  4 23:06:06 2012
@@ -98,10 +98,6 @@ public final class ApacheSchemaConstants
     public final static String APACHE_PRESENCE_AT = "ApachePresence";
     public final static String APACHE_PRESENCE_AT_OID = "1.3.6.1.4.1.18060.0.4.1.2.3";
 
-    // ApacheOneLevel
-    public final static String APACHE_ONE_LEVEL_AT = "apacheOneLevel";
-    public final static String APACHE_ONE_LEVEL_AT_OID = "1.3.6.1.4.1.18060.0.4.1.2.4";
-
     // ApacheOneAlias
     public final static String APACHE_ONE_ALIAS_AT = "apacheOneAlias";
     public final static String APACHE_ONE_ALIAS_AT_OID = "1.3.6.1.4.1.18060.0.4.1.2.5";

Modified: directory/apacheds/branches/index-work/jdbm-partition/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/jdbm-partition/pom.xml?rev=1309620&r1=1309619&r2=1309620&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/jdbm-partition/pom.xml (original)
+++ directory/apacheds/branches/index-work/jdbm-partition/pom.xml Wed Apr  4 23:06:06 2012
@@ -57,7 +57,7 @@
     
     <dependency>
       <groupId>org.apache.directory.jdbm</groupId>
-      <artifactId>apacheds-jdbm2</artifactId>
+      <artifactId>apacheds-jdbm</artifactId>
       <type>bundle</type>
     </dependency>
     

Modified: directory/apacheds/branches/index-work/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/index-work/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java?rev=1309620&r1=1309619&r2=1309620&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
(original)
+++ directory/apacheds/branches/index-work/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
Wed Apr  4 23:06:06 2012
@@ -247,11 +247,6 @@ public class JdbmStoreTest
         jdbmPartition.addIndex( new JdbmIndex<String, Entry>( ApacheSchemaConstants.APACHE_PRESENCE_AT_OID
) );
         assertNotNull( jdbmPartition.getPresenceIndex() );
 
-        assertNull( jdbmPartition.getOneLevelIndex() );
-        ( ( Store<Entry, Long> ) jdbmPartition ).addIndex( new JdbmIndex<Long, Entry>(
-            ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID ) );
-        assertNotNull( jdbmPartition.getOneLevelIndex() );
-
         assertNull( jdbmPartition.getSubLevelIndex() );
         ( ( Store<Entry, Long> ) jdbmPartition ).addIndex( new JdbmIndex<Long, Entry>(
             ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID ) );
@@ -331,16 +326,6 @@ public class JdbmStoreTest
         {
         }
 
-        assertNotNull( store.getOneLevelIndex() );
-        try
-        {
-            store.addIndex( new JdbmIndex<Long, Entry>( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID
) );
-            fail();
-        }
-        catch ( IllegalStateException e )
-        {
-        }
-
         assertNotNull( store.getSubLevelIndex() );
         try
         {
@@ -405,7 +390,7 @@ public class JdbmStoreTest
 
         Iterator<String> systemIndices = store.getSystemIndices();
 
-        for ( int ii = 0; ii < 10; ii++ )
+        for ( int ii = 0; ii < 9; ii++ )
         {
             assertTrue( systemIndices.hasNext() );
             assertNotNull( systemIndices.next() );

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java?rev=1309620&r1=1309619&r2=1309620&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
(original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
Wed Apr  4 23:06:06 2012
@@ -150,9 +150,6 @@ public abstract class AbstractBTreeParti
     /** a system index on objectClass attribute*/
     protected Index<String, Entry, ID> objectClassIdx;
 
-    /** the parent child relationship index */
-    protected Index<ID, Entry, ID> oneLevelIdx;
-
     /** a system index on the entries of descendants of root Dn */
     protected Index<ID, Entry, ID> subLevelIdx;
 
@@ -299,12 +296,6 @@ public abstract class AbstractBTreeParti
             addIndex( index );
         }
 
-        if ( getOneLevelIndex() == null )
-        {
-            Index<ID, Entry, ID> index = createSystemIndex( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID,
partitionPath, WITH_REVERSE );
-            addIndex( index );
-        }
-
         if ( getSubLevelIndex() == null )
         {
             Index<ID, Entry, ID> index = createSystemIndex( ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID,
partitionPath, WITH_REVERSE );
@@ -364,7 +355,6 @@ public abstract class AbstractBTreeParti
         // set index shortcuts
         rdnIdx = ( Index<ParentIdAndRdn<ID>, Entry, ID> ) systemIndices.get(
ApacheSchemaConstants.APACHE_RDN_AT_OID );
         presenceIdx = ( Index<String, Entry, ID> ) systemIndices.get( ApacheSchemaConstants.APACHE_PRESENCE_AT_OID
);
-        oneLevelIdx = ( Index<ID, Entry, ID> ) systemIndices.get( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID
);
         subLevelIdx = ( Index<ID, Entry, ID> ) systemIndices.get( ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID
);
         aliasIdx = ( Index<String, Entry, ID> ) systemIndices.get( ApacheSchemaConstants.APACHE_ALIAS_AT_OID
);
         oneAliasIdx = ( Index<ID, Entry, ID> ) systemIndices.get( ApacheSchemaConstants.APACHE_ONE_ALIAS_AT_OID
);
@@ -693,9 +683,6 @@ public abstract class AbstractBTreeParti
                 addAliasIndices( id, entryDn, aliasAttr.getString() );
             }
 
-            // Update the OneLevel index
-            oneLevelIdx.add( parentId, id );
-
             // Update the SubLevel index
             ID tempId = parentId;
 
@@ -892,7 +879,6 @@ public abstract class AbstractBTreeParti
             
             dumpRdnIdx();
 
-            oneLevelIdx.drop( id );
             subLevelIdx.drop( id );
             entryCsnIdx.drop( entry.get( ENTRY_CSN_AT ).getString(), id );
             entryUuidIdx.drop( entry.get( ENTRY_UUID_AT ).getString(), id );
@@ -1544,9 +1530,6 @@ public abstract class AbstractBTreeParti
          * Drop the old parent child relationship and add the new one
          * Set the new parent id for the child replacing the old parent id
          */
-        oneLevelIdx.drop( oldParentId, entryId );
-        oneLevelIdx.add( newParentId, entryId );
-
         updateSubLevelIndex( entryId, oldParentId, newParentId );
 
         // Update the Rdn index
@@ -1731,9 +1714,6 @@ public abstract class AbstractBTreeParti
          * Drop the old parent child relationship and add the new one
          * Set the new parent id for the child replacing the old parent id
          */
-        oneLevelIdx.drop( oldParentId, entryId );
-        oneLevelIdx.add( newParentId, entryId );
-
         updateSubLevelIndex( entryId, oldParentId, newParentId );
 
         /*
@@ -2363,16 +2343,6 @@ public abstract class AbstractBTreeParti
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
-    public Index<ID, Entry, ID> getOneLevelIndex()
-    {
-        return ( Index<ID, Entry, ID> ) systemIndices.get( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID
);
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    @SuppressWarnings("unchecked")
     public Index<ID, Entry, ID> getSubLevelIndex()
     {
         return ( Index<ID, Entry, ID> ) systemIndices.get( ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID
);

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java?rev=1309620&r1=1309619&r2=1309620&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
(original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
Wed Apr  4 23:06:06 2012
@@ -91,7 +91,6 @@ public interface Store<E, ID extends Com
     public static final String[] SYS_INDEX_OID_ARRAY =
         {
             ApacheSchemaConstants.APACHE_PRESENCE_AT_OID,
-            ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID,
             ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID,
             ApacheSchemaConstants.APACHE_RDN_AT_OID,
             ApacheSchemaConstants.APACHE_ALIAS_AT_OID,
@@ -180,12 +179,6 @@ public interface Store<E, ID extends Com
 
 
     /**
-     * @return The OneLevel system index
-     */
-    Index<ID, E, ID> getOneLevelIndex();
-
-
-    /**
      * @return The SubLevel system index
      */
     Index<ID, E, ID> getSubLevelIndex();

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/PartitionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/PartitionTest.java?rev=1309620&r1=1309619&r2=1309620&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/PartitionTest.java
(original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/PartitionTest.java
Wed Apr  4 23:06:06 2012
@@ -148,7 +148,6 @@ public class PartitionTest
     public void testExampleDataIndices() throws Exception
     {
         assertEquals( 11, partition.getRdnIndex().count() );
-        assertEquals( 11, partition.getOneLevelIndex().count() );
         assertEquals( 19, partition.getSubLevelIndex().count() );
         assertEquals( 3, partition.getAliasIndex().count() );
         assertEquals( 3, partition.getOneAliasIndex().count() );

Modified: directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java?rev=1309620&r1=1309619&r2=1309620&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java
(original)
+++ directory/apacheds/branches/index-work/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java
Wed Apr  4 23:06:06 2012
@@ -172,10 +172,6 @@ public class AvlPartitionTest
         avlPartition.addIndex( new AvlIndex<String, Entry>( ApacheSchemaConstants.APACHE_PRESENCE_AT_OID
) );
         assertNotNull( avlPartition.getPresenceIndex() );
 
-        assertNull( avlPartition.getOneLevelIndex() );
-        avlPartition.addIndex( new AvlIndex<Long, Entry>( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID
) );
-        assertNotNull( avlPartition.getOneLevelIndex() );
-
         assertNull( avlPartition.getSubLevelIndex() );
         avlPartition.addIndex( new AvlIndex<Long, Entry>( ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID
) );
         assertNotNull( avlPartition.getSubLevelIndex() );
@@ -246,17 +242,6 @@ public class AvlPartitionTest
         {
         }
 
-        assertNotNull( partition.getOneLevelIndex() );
-
-        try
-        {
-            partition.addIndex( new AvlIndex<Long, Entry>( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID
) );
-            //fail();
-        }
-        catch ( IllegalStateException e )
-        {
-        }
-
         assertNotNull( partition.getSubLevelIndex() );
 
         try
@@ -317,7 +302,7 @@ public class AvlPartitionTest
 
         Iterator<String> systemIndices = partition.getSystemIndices();
 
-        for ( int i = 0; i < 10; i++ )
+        for ( int i = 0; i < 9; i++ )
         {
             assertTrue( systemIndices.hasNext() );
             assertNotNull( systemIndices.next() );



Mime
View raw message