String message = "No entries found in the given LDIF file, aborting bulk load";
System.out.println( message );
LOG.info( message );
}
MavibotPartition partition = null;
try
{
long partT0 = System.currentTimeMillis();
System.out.print( "Creating partition..." );
DnFactory dnFactory = new DefaultDnFactory( schemaManager, null );
partition = new MavibotPartition( schemaManager, dnFactory );
partition.setId( "builder" );
partition.setSuffixDn( suffixDn );
File dir = new File( outputDir );
partition.setPartitionPath( dir.toURI() );
for( String atName : indexAttributes )
{
schemaManager.lookupAttributeTypeRegistry( atName );
partition.addIndex( new MavibotIndex( atName, false ) );
}
partition.initialize();
masterTableName = partition.getMasterTable().getName();
rm = partition.getRecordMan();
long partT1 = System.currentTimeMillis();
System.out.println( ", time taken : " + ( partT1 - partT0 ) + "ms" );
}
catch ( Exception e )
{
LOG.warn( "Failed to initialize the partition", e );
return;
}
try
{
long masterT0 = System.currentTimeMillis();
System.out.print( "Building master table..." );
buildMasterTable( sortedDnSet );
long masterT1 = System.currentTimeMillis();
System.out.println( ", time taken : " + ( masterT1 - masterT0 ) + "ms" );
}
catch( Exception e )
{
LOG.warn( "Failed to build master table", e );
e.printStackTrace();
return;
}
Iterator<String> userIndexItr = partition.getUserIndices();
try
{
// the RecordManager must be re-initialized cause we are
// setting the "values" of leaves to null while building
// the tree to avoid OOM errors
partition.destroy();
rm = new RecordManager( new File( partition.getPartitionPath() ).getAbsolutePath() );
long rdnT0 = System.currentTimeMillis();
System.out.print( "Building RDN index." );
buildRdnIndex( sortedDnSet );
long rdnT1 = System.currentTimeMillis();
System.out.println( ", time taken : " + ( rdnT1 - rdnT0 ) + "ms" );
}
catch( Exception e )
{
LOG.warn( "Failed to build the RDN index", e );
return;
}
// not needed anymore
System.out.println( "Clearing the sorted DN set." );
sortedDnSet.clear();
for( Index<?, String> id : partition.getAllIndices() )
{
// RDN and presence indices are built separately
String oid = id.getAttribute().getOid();
if( ApacheSchemaConstants.APACHE_RDN_AT_OID.equals( oid )