// --------------------------------------------------------------------
// If not present extract schema partition from jar
// --------------------------------------------------------------------
SchemaPartitionExtractor extractor = null;
try
{
extractor = new SchemaPartitionExtractor( directoryService.getWorkingDirectory() );
extractor.extract();
}
catch ( IOException e )
{
NamingException ne = new NamingException( "Failed to extract pre-loaded schema partition." );
ne.setRootCause( e );
throw ne;
}
// --------------------------------------------------------------------
// Initialize schema partition
// --------------------------------------------------------------------
schemaPartition = new JdbmPartition();
schemaPartition.setId( "schema" );
schemaPartition.setCacheSize( 1000 );
Set<Index<?, ServerEntry>> indexedAttributes = new HashSet<Index<?, ServerEntry>>();
for ( String attributeId : extractor.getDbFileListing().getIndexedAttributes() )
{
indexedAttributes.add( new JdbmIndex<String,ServerEntry>( attributeId ) );
}
schemaPartition.setIndexedAttributes( indexedAttributes );