Lucene++ - a full-featured, c++ search engine
API Documentation
Go to the documentation of this file.
7 #ifndef TIMELIMITINGCOLLECTOR_H
8 #define TIMELIMITINGCOLLECTOR_H
92 friend class TimerThread;
int64_t timeout
Definition: TimeLimitingCollector.h:42
static int64_t getResolution()
Return the timer resolution.
boost::shared_ptr< TimerThread > TimerThreadPtr
Definition: LuceneTypes.h:470
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
virtual void collect(int32_t doc)
Calls Collector#collect(int) on the decorated Collector unless the allowed time has passed,...
virtual void setNextReader(const IndexReaderPtr &reader, int32_t docBase)
Called before collecting from each IndexReader. All doc ids in collect(int32_t) will correspond to re...
static const int32_t DEFAULT_RESOLUTION
Default timer resolution.
Definition: TimeLimitingCollector.h:26
CollectorPtr collector
Definition: TimeLimitingCollector.h:43
The TimeLimitingCollector is used to timeout search requests that take longer than the maximum allowe...
Definition: TimeLimitingCollector.h:17
int64_t t0
Definition: TimeLimitingCollector.h:41
virtual ~TimeLimitingCollector()
static TimerThreadPtr TIMER_THREAD()
Initialize a single static timer thread to be used by all TimeLimitedCollector instances.
Definition: AbstractAllTermDocs.h:12
int32_t docBase
Definition: TimeLimitingCollector.h:45
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition: LuceneTypes.h:157
bool isGreedy()
Checks if this time limited collector is greedy in collecting the last hit. A non greedy collector,...
TimeLimitingCollector(const CollectorPtr &collector, int64_t timeAllowed)
Create a TimeLimitedCollector wrapper over another Collector with a specified timeout.
static int64_t resolution
Definition: TimeLimitingCollector.h:38
boost::shared_ptr< Collector > CollectorPtr
Definition: LuceneTypes.h:295
boost::shared_ptr< Scorer > ScorerPtr
Definition: LuceneTypes.h:429
virtual void setScorer(const ScorerPtr &scorer)
Called before successive calls to collect(int32_t). Implementations that need the score of the curren...
void setGreedy(bool greedy)
Sets whether this time limited collector is greedy.
static void stopTimer()
Stop timer thread.
static void setResolution(int64_t newResolution)
Set the timer resolution. The default timer resolution is 20 milliseconds. This means that a search r...
bool greedy
Definition: TimeLimitingCollector.h:39
bool DEFAULT_GREEDY
Default for isGreedy().
Definition: TimeLimitingCollector.h:35
virtual bool acceptsDocsOutOfOrder()
Return true if this collector does not require the matching docIDs to be delivered in int sort order ...
Collectors are primarily meant to be used to gather raw results from a search, and implement sorting ...
Definition: Collector.h:100
clucene.sourceforge.net