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 2014/05/12 20:45:59 UTC

svn commit: r1594050 - /directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java

Author: elecharny
Date: Mon May 12 18:45:59 2014
New Revision: 1594050

URL: http://svn.apache.org/r1594050
Log:
We also have to add the list of system index into the list of index to rebuild, if they are missing.

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

Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java?rev=1594050&r1=1594049&r2=1594050&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java Mon May 12 18:45:59 2014
@@ -65,6 +65,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.xdbm.Index;
+import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.search.impl.CursorBuilder;
 import org.apache.directory.server.xdbm.search.impl.DefaultOptimizer;
 import org.apache.directory.server.xdbm.search.impl.DefaultSearchEngine;
@@ -161,6 +162,7 @@ public class JdbmPartition extends Abstr
 
             List<Index<?, String>> indexToBuild = new ArrayList<Index<?, String>>();
             
+            // Iterate on the declared indexes
             for ( Index<?, String> index : getIndexedAttributes() )
             {
                 // Index won't be initialized at this time, so lookup AT registry to get the OID
@@ -177,6 +179,22 @@ public class JdbmPartition extends Abstr
                     indexToBuild.add( index );
                 }
             }
+            
+            // Don't forget to add the system indexes
+            for ( String systemIndex : Store.SYS_INDEX_OIDS )
+            {
+                allIndices.add( systemIndex );
+                
+                // take the part after removing .db from the
+                String name = systemIndex + JDBM_DB_FILE_EXTN;
+                
+                // if the name doesn't exist in the list of index DB files
+                // this is a new index and we need to build it
+                if ( !indexDbFileNameList.contains( name ) )
+                {
+                    indexToBuild.add( systemIndices.get( systemIndex ) );
+                }
+            }
 
             // Initialize the indexes
             super.doInit();