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.

Afficher le fichier Open project: paulirwin/lucene.net Class Usage Examples

Méthodes publiques

Méthode 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

Méthode Description
DecrWaiters ( ) : bool
IncWaiters ( ) : bool

Method Details

AnyStalledThreads() public méthode

public AnyStalledThreads ( ) : bool
Résultat bool

HasBlocked() public méthode

public HasBlocked ( ) : bool
Résultat bool

IsThreadQueued() public méthode

public IsThreadQueued ( Lucene.Net.Support.ThreadClass t ) : bool
t Lucene.Net.Support.ThreadClass
Résultat bool

UpdateStalled() public méthode

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
Résultat void

WaitIfStalled() public méthode

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

WasStalled() public méthode

public WasStalled ( ) : bool
Résultat bool