org.apache.lucene.index
Class ConcurrentMergeScheduler
- java.lang.Object
-
- org.apache.lucene.index.MergeScheduler
-
- org.apache.lucene.index.ConcurrentMergeScheduler
-
public class ConcurrentMergeScheduler extends MergeScheduler
AMergeSchedulerthat runs each merge using a separate thread, up until a maximum number of threads (setMaxThreadCount(int)) at which points merges are run in the foreground, serially. This is a simple way to use concurrency in the indexing process without having to create and manage application level threads.
-
-
Constructor Summary
Constructors Constructor and Description ConcurrentMergeScheduler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static booleananyUnhandledExceptions()Used for testingvoidclose()Close this MergeScheduler.intgetMaxThreadCount()Get the max # simultaneous threads that may be running.intgetMergeThreadPriority()Return the priority that merge threads run at.voidmerge(IndexWriter writer)Run the merges provided byIndexWriter.getNextMerge().voidsetMaxThreadCount(int count)Sets the max # simultaneous threads that may be running.voidsetMergeThreadPriority(int pri)Return the priority that merge threads run at.static voidsetTestMode()voidsync()
-
-
-
Method Detail
-
setMaxThreadCount
public void setMaxThreadCount(int count)
Sets the max # simultaneous threads that may be running. If a merge is necessary yet we already have this many threads running, the merge is returned back to IndexWriter so that it runs in the "foreground".
-
getMaxThreadCount
public int getMaxThreadCount()
Get the max # simultaneous threads that may be running. @see #setMaxThreadCount.
-
getMergeThreadPriority
public int getMergeThreadPriority()
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.
-
setMergeThreadPriority
public void setMergeThreadPriority(int pri)
Return the priority that merge threads run at.
-
close
public void close()
Description copied from class:MergeSchedulerClose this MergeScheduler.
-
sync
public void sync()
-
merge
public void merge(IndexWriter writer) throws CorruptIndexException, java.io.IOException
Description copied from class:MergeSchedulerRun the merges provided byIndexWriter.getNextMerge().- Throws:
CorruptIndexExceptionjava.io.IOException
-
anyUnhandledExceptions
public static boolean anyUnhandledExceptions()
Used for testing
-
setTestMode
public static void setTestMode()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG