in = new SerializerInputStream( zis );
final int order = in.readInt(); // ToDo: should do something with this?
final byte type = in.readByte();
final boolean caseSensitive = in.readBoolean();
Store rs = null;
boolean burstMode = Store.isBurstMode();
try
{
System.gc();
Store.safeDeleteRecordStore( name );
Store.setBurstMode( !ControlledTask.isBackgroundTask() );
rs = Store.get( name, 1 );
rs.open( true );
log.debug( "created recordstore" );
final int size = in.readInt();
log.debug( "index size (entries): " + size );
if( size > 0 )
{
final ProgressEvent event = new ProgressEvent();
event.setAnimate( false );
event.setCurrentValue( 0 );
event.setMaxValue( new Integer( size ) );
event.dispatch();
for( int j = 0; j < size; j++ )
{
log.debug( "record: " + j );
final byte[] data = in.readBlob();
int rid = rs.addRecord( data, 0, data.length );
log.debug( "record added (" + rid + "): " + data.length + " bytes" );
event.increment();
event.dispatch();
if( j == 0 && rid != 1 )
{
ErrorLog.addError(
"DbTool",
"processIndex",
null,
"Old not erased, recordId is not 1 (" + rid + ")",
null
);
log.error( "RecordId is not 1!!!!" );
throw new IOException( "Old not erased" );
}
if( j % 100 == 0 )
{
System.gc();
}
}
}
System.gc();
log.debug( "index " + name + " finished" );
}
finally
{
try{ if( rs != null ) rs.close(); }catch( Exception e ){}
Store.setBurstMode( burstMode );
}
}
finally
{