|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.index.MergeScheduler org.apache.lucene.index.ConcurrentMergeScheduler
public class 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 Class Summary | |
---|---|
protected class |
ConcurrentMergeScheduler.MergeThread
|
Field Summary | |
---|---|
protected Directory |
dir
|
protected int |
mergeThreadCount
|
protected List<ConcurrentMergeScheduler.MergeThread> |
mergeThreads
|
protected IndexWriter |
writer
|
Constructor Summary | |
---|---|
ConcurrentMergeScheduler()
|
Method Summary | |
---|---|
static boolean |
anyUnhandledExceptions()
Used for testing |
static void |
clearUnhandledExceptions()
|
void |
close()
Close this MergeScheduler. |
protected void |
doMerge(MergePolicy.OneMerge merge)
Does the actual merge, by calling IndexWriter.merge(org.apache.lucene.index.MergePolicy.OneMerge) |
int |
getMaxThreadCount()
Get the max # simultaneous threads that may be running. |
protected ConcurrentMergeScheduler.MergeThread |
getMergeThread(IndexWriter writer,
MergePolicy.OneMerge merge)
Create and return a new MergeThread |
int |
getMergeThreadPriority()
Return the priority that merge threads run at. |
protected void |
handleMergeException(Throwable exc)
Called when an exception is hit in a background merge thread |
void |
merge(IndexWriter writer)
Run the merges provided by IndexWriter.getNextMerge() . |
void |
setMaxThreadCount(int count)
Sets the max # simultaneous threads that may be running. |
void |
setMergeThreadPriority(int pri)
Set the priority that merge threads run at. |
static void |
setTestMode()
|
void |
sync()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected List<ConcurrentMergeScheduler.MergeThread> mergeThreads
protected Directory dir
protected IndexWriter writer
protected int mergeThreadCount
Constructor Detail |
---|
public ConcurrentMergeScheduler()
Method Detail |
---|
public void setMaxThreadCount(int count)
public int getMaxThreadCount()
public int getMergeThreadPriority()
public void setMergeThreadPriority(int pri)
public void close()
MergeScheduler
public void sync()
public void merge(IndexWriter writer) throws CorruptIndexException, IOException
MergeScheduler
IndexWriter.getNextMerge()
.
CorruptIndexException
IOException
protected void doMerge(MergePolicy.OneMerge merge) throws IOException
IndexWriter.merge(org.apache.lucene.index.MergePolicy.OneMerge)
IOException
protected ConcurrentMergeScheduler.MergeThread getMergeThread(IndexWriter writer, MergePolicy.OneMerge merge) throws IOException
IOException
protected void handleMergeException(Throwable exc)
public static boolean anyUnhandledExceptions()
public static void clearUnhandledExceptions()
public static void setTestMode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |