org.apache.lucene.index
Class ExecutorMergeScheduler

java.lang.Object
  extended by org.apache.lucene.index.MergeScheduler
      extended by org.apache.lucene.index.ExecutorMergeScheduler

public class ExecutorMergeScheduler
extends MergeScheduler

The executor merge scheduler is similar to Lucene ConcurrentMergeScheduler but instead of spawning threads it uses Compass ExecutorManager in order to execute the merges.

Since the executor manager is a thread pool, there is no need to have the running threads continue to ask the index writer for more merges. Instead, it simple reexecute another possible merge with the executor manager.

Author:
kimchy

Field Summary
(package private) static boolean anyExceptions
           
 
Constructor Summary
ExecutorMergeScheduler(ExecutorManager executorManager, TransactionContext transactionContext)
           
 
Method Summary
(package private)  void clearSuppressExceptions()
          Used for testing
 void close()
           
 int getMaxConcurrentMerges()
           
 void merge(IndexWriter writer)
           
 void setMaxConcurrentMerges(int maxConcurrentMerges)
           
(package private)  void setSuppressExceptions()
          Used for testing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

anyExceptions

static boolean anyExceptions
Constructor Detail

ExecutorMergeScheduler

public ExecutorMergeScheduler(ExecutorManager executorManager,
                              TransactionContext transactionContext)
Method Detail

getMaxConcurrentMerges

public int getMaxConcurrentMerges()

setMaxConcurrentMerges

public void setMaxConcurrentMerges(int maxConcurrentMerges)

close

public void close()
Specified by:
close in class MergeScheduler

merge

public void merge(IndexWriter writer)
           throws CorruptIndexException,
                  IOException
Specified by:
merge in class MergeScheduler
Throws:
CorruptIndexException
IOException

setSuppressExceptions

void setSuppressExceptions()
Used for testing


clearSuppressExceptions

void clearSuppressExceptions()
Used for testing



Copyright (c) 2004-2009 The Compass Project.