Class MTTransactionProcessorFactory

  extended by
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.


Constructor Summary
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


public MTTransactionProcessorFactory()
Method Detail


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

Specified by:
setSearchEngineFactory in interface SearchEngineFactoryAware


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

Specified by:
create in interface TransactionProcessorFactory


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

Specified by:
close in interface TransactionProcessorFactory


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

Specified by:
isThreadSafe in interface TransactionProcessorFactory


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.


Copyright (c) 2004-2009 The Compass Project.