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 2015/02/07 20:47:45 UTC
svn commit: r1658100 -
/directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java
Author: elecharny
Date: Sat Feb 7 19:47:45 2015
New Revision: 1658100
URL: http://svn.apache.org/r1658100
Log:
Added suppport for MavibotIndex in annotations
Modified:
directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java
Modified: directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java?rev=1658100&r1=1658099&r2=1658100&view=diff
==============================================================================
--- directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java (original)
+++ directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java Sat Feb 7 19:47:45 2015
@@ -52,6 +52,7 @@ import org.apache.directory.server.core.
import org.apache.directory.server.core.authn.DelegatingAuthenticator;
import org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition;
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
+import org.apache.directory.server.core.partition.impl.btree.mavibot.MavibotIndex;
import org.apache.directory.server.i18n.I18n;
import org.junit.runner.Description;
import org.slf4j.Logger;
@@ -211,7 +212,7 @@ public class DSAnnotationProcessor
createPartition.suffix(),
createPartition.cacheSize(),
new File( service.getInstanceLayout().getPartitionsDirectory(), createPartition.name() ) );
-
+
partition.setCacheService( service.getCacheService() );
CreateIndex[] indexes = createPartition.indexes();
@@ -250,12 +251,29 @@ public class DSAnnotationProcessor
for ( CreateIndex createIndex : indexes )
{
- // The annotation does not specify a specific index
- // type.
- // We use the generic index implementation.
- JdbmIndex index = new JdbmIndex( createIndex.attribute(), false );
+ if ( createIndex.type() == JdbmIndex.class )
+ {
+ // JDBM index
+ JdbmIndex index = new JdbmIndex( createIndex.attribute(), false );
+
+ btreePartition.addIndexedAttributes( index );
+ }
+ else if ( createIndex.type() == MavibotIndex.class )
+ {
+ // Mavibot index
+ MavibotIndex index = new MavibotIndex( createIndex.attribute(), false );
+
+ btreePartition.addIndexedAttributes( index );
+ }
+ else
+ {
+ // The annotation does not specify a specific index
+ // type.
+ // We use the generic index implementation.
+ JdbmIndex index = new JdbmIndex( createIndex.attribute(), false );
- btreePartition.addIndexedAttributes( index );
+ btreePartition.addIndexedAttributes( index );
+ }
}
}
}