C# Класс 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.

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
DecrWaiters ( ) : bool
IncWaiters ( ) : bool

Описание методов

AnyStalledThreads() публичный Метод

public AnyStalledThreads ( ) : bool
Результат bool

HasBlocked() публичный Метод

public HasBlocked ( ) : bool
Результат bool

IsThreadQueued() публичный Метод

public IsThreadQueued ( Lucene.Net.Support.ThreadClass t ) : bool
t Lucene.Net.Support.ThreadClass
Результат bool

UpdateStalled() публичный Метод

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
Результат void

WaitIfStalled() публичный Метод

Blocks if documents writing is currently in a stalled state.
public WaitIfStalled ( ) : void
Результат void

WasStalled() публичный Метод

public WasStalled ( ) : bool
Результат bool