Save This Page
Home » lucene-2.4.1-src » org.apache » lucene » index » [javadoc | source]
org.apache.lucene.index
public class: ConcurrentMergeScheduler [javadoc | source]
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 ) 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  List mergeThreads     
protected  Directory dir     
protected  IndexWriter writer     
protected  int mergeThreadCount     
static  boolean anyExceptions     
Constructor:
 public ConcurrentMergeScheduler() 
Method from org.apache.lucene.index.ConcurrentMergeScheduler Summary:
anyUnhandledExceptions,   clearSuppressExceptions,   clearUnhandledExceptions,   close,   doMerge,   getMaxThreadCount,   getMergeThread,   getMergeThreadPriority,   handleMergeException,   merge,   setMaxThreadCount,   setMergeThreadPriority,   setSuppressExceptions,   setTestMode,   sync
Methods from org.apache.lucene.index.MergeScheduler:
close,   merge
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.lucene.index.ConcurrentMergeScheduler Detail:
 public static boolean anyUnhandledExceptions() 
    Used for testing
  void clearSuppressExceptions() 
    Used for testing
 public static  void clearUnhandledExceptions() 
 public  void close() 
 protected  void doMerge(MergePolicy.OneMerge merge) throws IOException 
 public int getMaxThreadCount() 
    Get the max # simultaneous threads that may be running. @see #setMaxThreadCount.
 protected synchronized ConcurrentMergeScheduler.MergeThread getMergeThread(IndexWriter writer,
    MergePolicy.OneMerge merge) throws IOException 
    Create and return a new MergeThread
 public synchronized 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.
 protected  void handleMergeException(Throwable exc) 
    Called when an exception is hit in a background merge thread
 public  void merge(IndexWriter writer) throws IOException, CorruptIndexException 
 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 incoming thread (that is calling add/updateDocument) will block until a merge thread has completed.
 public synchronized  void setMergeThreadPriority(int pri) 
    Return the priority that merge threads run at.
  void setSuppressExceptions() 
    Used for testing
 public static  void setTestMode() 
 public synchronized  void sync()