Class FlushPolicy

java.lang.Object
org.apache.lucene.index.FlushPolicy
Direct Known Subclasses:
FlushByRamOrCountsPolicy

abstract class FlushPolicy extends Object
FlushPolicy controls when segments are flushed from a RAM resident internal data-structure to the IndexWriters Directory.

Segments are traditionally flushed by:

IndexWriter consults the provided FlushPolicy to control the flushing process. The policy is informed for each added or updated document as well as for each delete term. Based on the FlushPolicy, the information provided via DocumentsWriterPerThread and DocumentsWriterFlushControl, the FlushPolicy decides if a DocumentsWriterPerThread needs flushing and mark it as flush-pending via DocumentsWriterFlushControl.setFlushPending(org.apache.lucene.index.DocumentsWriterPerThread), or if deletes need to be applied.

See Also: