C# Class Lucene.Net.Index.DocumentsWriterStallControl

Controls the health status of a DocumentsWriter sessions. this class used to block incoming indexing threads if flushing significantly slower than indexing to ensure the DocumentsWriters healthiness. If flushing is significantly slower than indexing the net memory used within an IndexWriter session can increase very quickly and easily exceed the JVM's available memory.

To prevent OOM Errors and ensure IndexWriter's stability this class blocks incoming threads from indexing once 2 x number of available ThreadStates in DocumentsWriterPerThreadPool is exceeded. Once flushing catches up and the number of flushing DWPT is equal or lower than the number of active ThreadStates threads are released and can continue indexing.

显示文件 Open project: paulirwin/lucene.net Class Usage Examples

Public Methods

Method Description
AnyStalledThreads ( ) : bool
HasBlocked ( ) : bool
IsThreadQueued ( Lucene.Net.Support.ThreadClass t ) : bool
UpdateStalled ( bool stalled ) : void

Update the stalled flag status. this method will set the stalled flag to true iff the number of flushing DocumentsWriterPerThread is greater than the number of active DocumentsWriterPerThread. Otherwise it will reset the DocumentsWriterStallControl to healthy and release all threads waiting on #waitIfStalled()

WaitIfStalled ( ) : void

Blocks if documents writing is currently in a stalled state.

WasStalled ( ) : bool

Private Methods

Method Description
DecrWaiters ( ) : bool
IncWaiters ( ) : bool

Method Details

AnyStalledThreads() public method

public AnyStalledThreads ( ) : bool
return bool

HasBlocked() public method

public HasBlocked ( ) : bool
return bool

IsThreadQueued() public method

public IsThreadQueued ( Lucene.Net.Support.ThreadClass t ) : bool
t Lucene.Net.Support.ThreadClass
return bool

UpdateStalled() public method

Update the stalled flag status. this method will set the stalled flag to true iff the number of flushing DocumentsWriterPerThread is greater than the number of active DocumentsWriterPerThread. Otherwise it will reset the DocumentsWriterStallControl to healthy and release all threads waiting on #waitIfStalled()
public UpdateStalled ( bool stalled ) : void
stalled bool
return void

WaitIfStalled() public method

Blocks if documents writing is currently in a stalled state.
public WaitIfStalled ( ) : void
return void

WasStalled() public method

public WasStalled ( ) : bool
return bool