org.compass.core.lucene.engine.transaction.mt
Class MTTransactionProcessorFactory

java.lang.Object
  extended by org.compass.core.lucene.engine.transaction.mt.MTTransactionProcessorFactory
All Implemented Interfaces:
SearchEngineFactoryAware, TransactionProcessorFactory

public class MTTransactionProcessorFactory
extends Object
implements TransactionProcessorFactory, SearchEngineFactoryAware

The MT (Multi Threaded) transaction processor allows for multi threaded indexing meaning several threads can perfom the indexing process using the same Transaction Processor (Search Engine or Session).

Actual operations are delegated to the respective sub index IndexWriter without any buffering or delegation to another thread pool. This makes this transaction processor useful mainly when there are several threas that will index data.

Author:
kimchy

Constructor Summary
MTTransactionProcessorFactory()
           
 
Method Summary
 void close()
          Closes the transaction factory.
 TransactionProcessor create(LuceneSearchEngine searchEngine)
          Creates a new MTTransactionProcessor.
<T> T
doUnderIndexWriterLock(String subIndex, Callable<T> task)
          Executes the provided task under a lock associtea with the given sub index.
 boolean isThreadSafe()
          MT transaction processor is thread safe.
 void setSearchEngineFactory(SearchEngineFactory searchEngineFactory)
          Injects the search engine factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MTTransactionProcessorFactory

public MTTransactionProcessorFactory()
Method Detail

setSearchEngineFactory

public void setSearchEngineFactory(SearchEngineFactory searchEngineFactory)
Description copied from interface: SearchEngineFactoryAware
Injects the search engine factory.

Specified by:
setSearchEngineFactory in interface SearchEngineFactoryAware

create

public TransactionProcessor create(LuceneSearchEngine searchEngine)
Creates a new MTTransactionProcessor.

Specified by:
create in interface TransactionProcessorFactory

close

public void close()
Description copied from interface: TransactionProcessorFactory
Closes the transaction factory.

Specified by:
close in interface TransactionProcessorFactory

isThreadSafe

public boolean isThreadSafe()
MT transaction processor is thread safe.

Specified by:
isThreadSafe in interface TransactionProcessorFactory

doUnderIndexWriterLock

public <T> T doUnderIndexWriterLock(String subIndex,
                                    Callable<T> task)
                         throws Exception
Executes the provided task under a lock associtea with the given sub index. Used when trying to open an index writer.

Throws:
Exception


Copyright (c) 2004-2009 The Compass Project.