public class DocumentIndexer extends Consumer<DocumentEvent,DocumentProducer> implements Runnable
Consumer
of DocumentEvent
s produced by a DocumentProducer
. Therefore it holds a queue of
DocumentProducer
s, whose DocumentEvent
s 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, putWithTimeout
public 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
DocumentProducer
Copyright © 2011–2023 aiticon GmbH. All rights reserved.