C# Class Lucene.Net.Index.IndexWriter.ReaderPool

Holds shared SegmentReader instances. IndexWriter uses SegmentReaders for 1) applying deletes, 2) doing merges, 3) handing out a real-time reader. this pool reuses instances of the SegmentReaders in all these places if it is in "near real-time mode" (getReader() has been called on this instance).
Inheritance: IDisposable
Show file Open project: synhershko/lucene.net

Public Methods

Method Description
Dispose ( ) : void

Remove all our references to readers, and commits any pending changes.

Get ( SegmentInfo info, bool doOpenStores ) : Lucene.Net.Index.SegmentReader

Obtain a SegmentReader from the readerPool. The reader must be returned by calling Release(SegmentReader)

Get ( SegmentInfo info, bool doOpenStores, int readBufferSize, int termsIndexDivisor ) : Lucene.Net.Index.SegmentReader

Obtain a SegmentReader from the readerPool. The reader must be returned by calling Release(SegmentReader)

GetIfExists ( SegmentInfo info ) : Lucene.Net.Index.SegmentReader
GetReadOnlyClone ( SegmentInfo info, bool doOpenStores, int termInfosIndexDivisor ) : Lucene.Net.Index.SegmentReader

Returns a ref to a clone. NOTE: this clone is not enrolled in the pool, so you should simply close() it when you're done (ie, do not call release()).

InfoIsLive ( SegmentInfo info ) : bool
MapToLive ( SegmentInfo info ) : SegmentInfo
ReaderPool ( IndexWriter enclosingInstance ) : System
Release ( Lucene.Net.Index.SegmentReader sr ) : void

Release the segment reader (i.e. decRef it and close if there are no more references.

Release ( Lucene.Net.Index.SegmentReader sr, bool drop ) : void

Release the segment reader (i.e. decRef it and close if there are no more references.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
Clear ( SegmentInfos infos ) : void

Forcefully clear changes for the specifed segments, and remove from the pool. This is called on succesful merge.

Commit ( ) : void

Commit all segment reader in the pool.

InitBlock ( IndexWriter enclosingInstance ) : void

Method Details

Dispose() public method

Remove all our references to readers, and commits any pending changes.
public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

Get() public method

Obtain a SegmentReader from the readerPool. The reader must be returned by calling Release(SegmentReader)
public Get ( SegmentInfo info, bool doOpenStores ) : Lucene.Net.Index.SegmentReader
info SegmentInfo ///
doOpenStores bool ///
return Lucene.Net.Index.SegmentReader

Get() public method

Obtain a SegmentReader from the readerPool. The reader must be returned by calling Release(SegmentReader)
public Get ( SegmentInfo info, bool doOpenStores, int readBufferSize, int termsIndexDivisor ) : Lucene.Net.Index.SegmentReader
info SegmentInfo ///
doOpenStores bool ///
readBufferSize int ///
termsIndexDivisor int ///
return Lucene.Net.Index.SegmentReader

GetIfExists() public method

public GetIfExists ( SegmentInfo info ) : Lucene.Net.Index.SegmentReader
info SegmentInfo
return Lucene.Net.Index.SegmentReader

GetReadOnlyClone() public method

Returns a ref to a clone. NOTE: this clone is not enrolled in the pool, so you should simply close() it when you're done (ie, do not call release()).
public GetReadOnlyClone ( SegmentInfo info, bool doOpenStores, int termInfosIndexDivisor ) : Lucene.Net.Index.SegmentReader
info SegmentInfo
doOpenStores bool
termInfosIndexDivisor int
return Lucene.Net.Index.SegmentReader

InfoIsLive() public method

public InfoIsLive ( SegmentInfo info ) : bool
info SegmentInfo
return bool

MapToLive() public method

public MapToLive ( SegmentInfo info ) : SegmentInfo
info SegmentInfo
return SegmentInfo

ReaderPool() public method

public ReaderPool ( IndexWriter enclosingInstance ) : System
enclosingInstance IndexWriter
return System

Release() public method

Release the segment reader (i.e. decRef it and close if there are no more references.
public Release ( Lucene.Net.Index.SegmentReader sr ) : void
sr Lucene.Net.Index.SegmentReader ///
return void

Release() public method

Release the segment reader (i.e. decRef it and close if there are no more references.
public Release ( Lucene.Net.Index.SegmentReader sr, bool drop ) : void
sr Lucene.Net.Index.SegmentReader ///
drop bool
return void