Class TimeLimitingCollector
The TimeLimitingCollector is used to timeout search requests that take longer than the maximum allowed search time limit. After this time is exceeded, the search thread is stopped by throwing a TimeLimitingCollector.TimeExceededException.
Inheritance
Assembly: DistributedLucene.Net.dll
Syntax
public class TimeLimitingCollector : object, ICollector
Constructors
Name | Description |
---|---|
TimeLimitingCollector(ICollector, Counter, Int64) | Create a TimeLimitingCollector wrapper over another ICollector with a specified timeout. |
Properties
Name | Description |
---|---|
AcceptsDocsOutOfOrder | |
GlobalCounter | Returns the global TimeLimitingCollector.TimerThread's Counter Invoking this creates may create a new instance of TimeLimitingCollector.TimerThread iff the global TimeLimitingCollector.TimerThread has never been accessed before. The thread returned from this method is started on creation and will be alive unless you stop the TimeLimitingCollector.TimerThread via StopTimer(). @lucene.experimental |
GlobalTimerThread | Returns the global TimeLimitingCollector.TimerThread. Invoking this creates may create a new instance of TimeLimitingCollector.TimerThread iff the global TimeLimitingCollector.TimerThread has never been accessed before. The thread returned from this method is started on creation and will be alive unless you stop the TimeLimitingCollector.TimerThread via StopTimer(). @lucene.experimental |
IsGreedy | Checks if this time limited collector is greedy in collecting the last hit. A non greedy collector, upon a timeout, would throw a TimeLimitingCollector.TimeExceededException without allowing the wrapped collector to collect current doc. A greedy one would first allow the wrapped hit collector to collect current doc and only then throw a TimeLimitingCollector.TimeExceededException. |
Methods
Name | Description |
---|---|
Collect(Int32) | Calls Collect(Int32) on the decorated ICollector unless the allowed time has passed, in which case it throws an exception. |
SetBaseline() | Syntactic sugar for SetBaseline(Int64) using Get() on the clock passed to the constructor. |
SetBaseline(Int64) | Sets the baseline for this collector. By default the collectors baseline is initialized once the first reader is passed to the collector. To include operations executed in prior to the actual document collection set the baseline through this method in your prelude. Example usage:
|
SetCollector(ICollector) | This is so the same timer can be used with a multi-phase search process such as grouping. We don't want to create a new TimeLimitingCollector for each phase because that would reset the timer for each phase. Once time is up subsequent phases need to timeout quickly. |
SetNextReader(AtomicReaderContext) | |
SetScorer(Scorer) |