public class DocumentIndexer extends Consumer<DocumentEvent,DocumentProducer> implements Runnable
Consumer of DocumentEvents produced by a DocumentProducer. Therefore it holds a queue of
DocumentProducers, whose DocumentEvents are being consumed with a timeout calling
BlockingQueueAccessor.get(long). This means if a DocumentProducer doesn't produce a new Document
within the given timeout, the producer is being discarded and the next one is taken.| Modifier and Type | Field and Description |
|---|---|
static Observable.Event |
CLEAR_INDEX |
| Constructor and Description |
|---|
DocumentIndexer(File indexDir,
Long timeout) |
DocumentIndexer(int queueSize,
File indexDir,
Long timeout)
Creates a new
DocumentIndexer. |
| Modifier and Type | Method and Description |
|---|---|
void |
run()
Starts this
DocumentIndexer, running forever (until interrupted). |
get, get, getBlockingQueue, getWithTimeout, put, put, putWithTimeoutpublic static final Observable.Event CLEAR_INDEX
public DocumentIndexer(int queueSize,
File indexDir,
Long timeout)
DocumentIndexer.indexDir - the directory to read/save the Lucene index from/totimeout - the timeout in milliseconds when retrieving the next DocumentEvent from a
DocumentProducerCopyright © 2011–2023 aiticon GmbH. All rights reserved.