if ( ( jdbmPartitionBean == null ) || jdbmPartitionBean.isDisabled() )
{
return null;
}
JdbmPartition jdbmPartition = new JdbmPartition( directoryService.getSchemaManager(),
directoryService.getDnFactory() );
jdbmPartition.setCacheSize( jdbmPartitionBean.getPartitionCacheSize() );
jdbmPartition.setId( jdbmPartitionBean.getPartitionId() );
jdbmPartition.setOptimizerEnabled( jdbmPartitionBean.isJdbmPartitionOptimizerEnabled() );
File partitionPath = new File( directoryService.getInstanceLayout().getPartitionsDirectory(),
jdbmPartitionBean.getPartitionId() );
jdbmPartition.setPartitionPath( partitionPath.toURI() );
try
{
jdbmPartition.setSuffixDn( jdbmPartitionBean.getPartitionSuffix() );
}
catch ( LdapInvalidDnException lide )
{
String message = "Cannot set the Dn " + jdbmPartitionBean.getPartitionSuffix() + ", " + lide.getMessage();
LOG.error( message );
throw new ConfigurationException( message );
}
jdbmPartition.setSyncOnWrite( jdbmPartitionBean.isPartitionSyncOnWrite() );
jdbmPartition.setIndexedAttributes( createJdbmIndexes( jdbmPartition, jdbmPartitionBean.getIndexes(),
directoryService ) );
setContextEntry( jdbmPartitionBean, jdbmPartition );
return jdbmPartition;