java.lang.Object | ||
↳ | org.apache.lucene.index.MergeScheduler | |
↳ | org.apache.lucene.index.ConcurrentMergeScheduler |
A MergeScheduler
that runs each merge using a
separate thread, up until a maximum number of threads
(setMaxThreadCount(int)
) at which when a merge is
needed, the thread(s) that are updating the index will
pause until one or more merges completes. This is a
simple way to use concurrency in the indexing process
without having to create and manage application level
threads.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ConcurrentMergeScheduler.MergeThread |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
dir | |||||||||||
mergeThreadCount | |||||||||||
mergeThreads | |||||||||||
writer |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Used for testing
| |||||||||||
Close this MergeScheduler.
| |||||||||||
Get the max # simultaneous threads that may be
running.
| |||||||||||
Return the priority that merge threads run at.
| |||||||||||
Run the merges provided by IndexWriter#getNextMerge().
| |||||||||||
Sets the max # simultaneous threads that may be
running.
| |||||||||||
Set the priority that merge threads run at.
| |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Does the actual merge, by calling IndexWriter#merge
| |||||||||||
Create and return a new MergeThread
| |||||||||||
Called when an exception is hit in a background merge
thread
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Used for testing
Close this MergeScheduler.
Get the max # simultaneous threads that may be running. @see #setMaxThreadCount.
Return the priority that merge threads run at. By default the priority is 1 plus the priority of (ie, slightly higher priority than) the first thread that calls merge.
Run the merges provided by IndexWriter#getNextMerge().
CorruptIndexException | |
---|---|
IOException |
Sets the max # simultaneous threads that may be running. If a merge is necessary yet we already have this many threads running, the incoming thread (that is calling add/updateDocument) will block until a merge thread has completed.
Set the priority that merge threads run at.
Does the actual merge, by calling IndexWriter#merge
IOException |
---|
Create and return a new MergeThread
IOException |
---|
Called when an exception is hit in a background merge thread