Class ControlledRealTimeReopenThread<T>
Utility class that runs a thread to manage periodic reopens of a ReferenceManager<G>, with methods to wait for a specific index changes to become visible. To use this class you must first wrap your IndexWriter with a TrackingIndexWriter and always use it to make changes to the index, saving the returned generation. Then, when a given search request needs to see a specific index change, call the WaitForGeneration(Int64) to wait for that change to be visible. Note that this will only scale well if most searches do not need to wait for a specific index generation.
@lucene.experimental
Inherited Members
Assembly: DistributedLucene.Net.dll
Syntax
public class ControlledRealTimeReopenThread<T> : ThreadClass, IThreadRunnable, IDisposable where T : class
Type Parameters
Name | Description |
---|---|
T |
Constructors
Name | Description |
---|---|
ControlledRealTimeReopenThread(TrackingIndexWriter, ReferenceManager<T>, Double, Double) | Create ControlledRealTimeReopenThread<T>, to periodically reopen the a ReferenceManager<G>. |
Methods
Name | Description |
---|---|
Dispose() | |
Run() | |
WaitForGeneration(Int64) | Waits for the target generation to become visible in the searcher. If the current searcher is older than the target generation, this method will block until the searcher is reopened, by another via MaybeRefresh() or until the ReferenceManager<G> is closed. |
WaitForGeneration(Int64, Int32) | Waits for the target generation to become visible in the searcher, up to a maximum specified milli-seconds. If the current searcher is older than the target generation, this method will block until the searcher has been reopened by another thread via MaybeRefresh(), the given waiting time has elapsed, or until the ReferenceManager<G> is closed. NOTE: if the waiting time elapses before the requested target generation is available the current SearcherManager is returned instead. |