@Override public void close() throws IOException { ByteBuffer writeBuffer = ByteBuffer.allocate( batchSize * ID_ENTRY_SIZE ); flushFreeIds( writeBuffer ); freeIds.addAll( readFromDisk ); flushFreeIds( writeBuffer ); if ( !aggressiveMode ) { compact( writeBuffer ); } channel.force( false ); }
public void freeId( long id ) { freeIds.enqueue( id ); freeIdCount++; if ( freeIds.size() >= batchSize ) { long endPosition = flushFreeIds( ByteBuffer.allocate( batchSize * ID_ENTRY_SIZE ) ); if ( aggressiveMode ) { stackPosition = endPosition; } } }
@Override public void close() throws IOException { ByteBuffer writeBuffer = ByteBuffer.allocate( batchSize * ID_ENTRY_SIZE ); flushFreeIds( writeBuffer ); freeIds.addAll( readFromDisk ); flushFreeIds( writeBuffer ); if ( !aggressiveMode ) { compact( writeBuffer ); } channel.force( false ); }
public void freeId( long id ) { freeIds.enqueue( id ); freeIdCount++; if ( freeIds.size() >= batchSize ) { long endPosition = flushFreeIds( ByteBuffer.allocate( batchSize * ID_ENTRY_SIZE ) ); if ( aggressiveMode ) { stackPosition = endPosition; } } }