partition.setId( createPartition.name() );
partition.setSuffixDn( new Dn( service.getSchemaManager(), createPartition.suffix() ) );
if ( partition instanceof AbstractBTreePartition )
{
AbstractBTreePartition btreePartition = ( AbstractBTreePartition ) partition;
btreePartition.setCacheSize( createPartition.cacheSize() );
btreePartition.setPartitionPath( new File( service
.getInstanceLayout().getPartitionsDirectory(),
createPartition.name() ).toURI() );
// Process the indexes if any
CreateIndex[] indexes = createPartition.indexes();
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 );
btreePartition.addIndexedAttributes( index );
}
}
}
partition.setSchemaManager( service.getSchemaManager() );