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 Index
Note
This API is experimental and might change in incompatible ways in the next release.
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.Search
Assembly: Lucene.Net.dll
Syntax
public class ControlledRealTimeReopenThread<T> : ThreadJob, IEquatable<ThreadJob>, IEquatable<Thread>, IDisposable where T : class
Type Parameters
Name | Description |
---|---|
T |
Constructors
| Improve this Doc View SourceControlledRealTimeReopenThread(TrackingIndexWriter, ReferenceManager<T>, Double, Double)
Create ControlledRealTimeReopenThread<T>, to periodically reopen the a ReferenceManager<G>.
Declaration
public ControlledRealTimeReopenThread(TrackingIndexWriter writer, ReferenceManager<T> manager, double targetMaxStaleSec, double targetMinStaleSec)
Parameters
Type | Name | Description |
---|---|---|
Tracking |
writer | |
Reference |
manager | |
System. |
targetMaxStaleSec | Maximum time until a new reader must be opened; this sets the upper bound on how slowly reopens may occur, when no caller is waiting for a specific generation to become visible. |
System. |
targetMinStaleSec | Mininum time until a new reader can be opened; this sets the lower bound on how quickly reopens may occur, when a caller is waiting for a specific generation to become visible. |
Methods
| Improve this Doc View SourceDispose()
Releases all resources used by the ControlledRealTimeReopenThread<T>.
Declaration
public void Dispose()
Dispose(Boolean)
Releases resources used by the ControlledRealTimeReopenThread<T> and if overridden in a derived class, optionally releases unmanaged resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System. |
disposing |
|
Run()
Declaration
public override void Run()
Overrides
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
Maybe
Declaration
public virtual void WaitForGeneration(long targetGen)
Parameters
Type | Name | Description |
---|---|---|
System. |
targetGen | The generation to wait for |
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
Maybe
NOTE: if the waiting time elapses before the requested target generation is
available the current Searcher
Declaration
public virtual bool WaitForGeneration(long targetGen, int maxMS)
Parameters
Type | Name | Description |
---|---|---|
System. |
targetGen | The generation to wait for |
System. |
maxMS | Maximum milliseconds to wait, or -1 to wait indefinitely |
Returns
Type | Description |
---|---|
System. |
|