org.compass.core.lucene.engine.transaction.lucene
Class LuceneTransactionProcessor

java.lang.Object
  extended by org.compass.core.lucene.engine.transaction.support.AbstractTransactionProcessor
      extended by org.compass.core.lucene.engine.transaction.support.AbstractSearchTransactionProcessor
          extended by org.compass.core.lucene.engine.transaction.support.AbstractConcurrentTransactionProcessor
              extended by org.compass.core.lucene.engine.transaction.lucene.LuceneTransactionProcessor
All Implemented Interfaces:
TransactionProcessor

public class LuceneTransactionProcessor
extends AbstractConcurrentTransactionProcessor

Lucene based transaction, allows to perfom dirty operations directly over the index using Lucene support for transactions. Reads and search will be performed on the index itself without taking into account any transactional operations.

Author:
kimchy

Field Summary
 
Fields inherited from class org.compass.core.lucene.engine.transaction.support.AbstractTransactionProcessor
indexManager, mapping, searchEngine, searchEngineFactory
 
Constructor Summary
LuceneTransactionProcessor(LuceneSearchEngine searchEngine)
           
 
Method Summary
protected  void doCommit(boolean onePhase)
          Sub classes should implement this.
protected  LuceneSearchEngineHits doFind(LuceneSearchEngineQuery query)
          Sub classes should implement this.
protected  Resource[] doGet(ResourceKey resourceKey)
          Base classes should implement this.
protected  LuceneSearchEngineInternalSearch doInternalSearch(String[] subIndexes, String[] aliases)
          Base classes should implement this.
protected  void doPrepare()
          Sub classes should implement this.
protected  void doProcessJob(TransactionJob job)
          Sub classes should implement the actual processing of a transactional job.
protected  void doRollback()
          Sub classes should implement this.
protected  String[] getDirtySubIndexes()
          Returns the current dirty sub indexes.
 String getName()
          Retuns the name of this transaction processor.
protected  IndexWriter getOrCreateIndexWriter(String subIndex)
           
protected  void prepareBeforeAsyncDirtyOperation(TransactionJob job)
          Just open an index writer here on the same calling thread so we maintain ordering of operations as well as no need for double check if we created it or not using expensive global locking.
 
Methods inherited from class org.compass.core.lucene.engine.transaction.support.AbstractConcurrentTransactionProcessor
begin, commit, create, delete, delete, doFlush, find, flush, flushCommit, get, internalSearch, isConcurrentOperations, prepare, rollback, update
 
Methods inherited from class org.compass.core.lucene.engine.transaction.support.AbstractSearchTransactionProcessor
performFind, performGet, performInternalSearch
 
Methods inherited from class org.compass.core.lucene.engine.transaction.support.AbstractTransactionProcessor
buildInternalSearch, findByQuery, getResourceMapping, getSettingName, isInvalidateCacheOnCommit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneTransactionProcessor

public LuceneTransactionProcessor(LuceneSearchEngine searchEngine)
Method Detail

getName

public String getName()
Description copied from interface: TransactionProcessor
Retuns the name of this transaction processor.


getDirtySubIndexes

protected String[] getDirtySubIndexes()
Description copied from class: AbstractConcurrentTransactionProcessor
Returns the current dirty sub indexes.

Specified by:
getDirtySubIndexes in class AbstractConcurrentTransactionProcessor

doRollback

protected void doRollback()
                   throws SearchEngineException
Description copied from class: AbstractConcurrentTransactionProcessor
Sub classes should implement this. Behaviour should be the same as AbstractConcurrentTransactionProcessor.rollback().

Specified by:
doRollback in class AbstractConcurrentTransactionProcessor
Throws:
SearchEngineException

doPrepare

protected void doPrepare()
                  throws SearchEngineException
Description copied from class: AbstractConcurrentTransactionProcessor
Sub classes should implement this. Behaviour should be the same as AbstractConcurrentTransactionProcessor.prepare().

Specified by:
doPrepare in class AbstractConcurrentTransactionProcessor
Throws:
SearchEngineException

doCommit

protected void doCommit(boolean onePhase)
                 throws SearchEngineException
Description copied from class: AbstractConcurrentTransactionProcessor
Sub classes should implement this. Behaviour should be the same as AbstractConcurrentTransactionProcessor.commit(boolean).

Specified by:
doCommit in class AbstractConcurrentTransactionProcessor
Throws:
SearchEngineException

doProcessJob

protected void doProcessJob(TransactionJob job)
                     throws SearchEngineException
Description copied from class: AbstractConcurrentTransactionProcessor
Sub classes should implement the actual processing of a transactional job.

Specified by:
doProcessJob in class AbstractConcurrentTransactionProcessor
Throws:
SearchEngineException

doFind

protected LuceneSearchEngineHits doFind(LuceneSearchEngineQuery query)
                                 throws SearchEngineException
Description copied from class: AbstractConcurrentTransactionProcessor
Sub classes should implement this. Behaviour should be the same as AbstractConcurrentTransactionProcessor.find(org.compass.core.lucene.engine.LuceneSearchEngineQuery).

Specified by:
doFind in class AbstractConcurrentTransactionProcessor
Throws:
SearchEngineException

doInternalSearch

protected LuceneSearchEngineInternalSearch doInternalSearch(String[] subIndexes,
                                                            String[] aliases)
                                                     throws SearchEngineException
Description copied from class: AbstractConcurrentTransactionProcessor
Base classes should implement this. Behaviour should be the same as AbstractConcurrentTransactionProcessor.internalSearch(String[], String[]).

Specified by:
doInternalSearch in class AbstractConcurrentTransactionProcessor
Throws:
SearchEngineException

doGet

protected Resource[] doGet(ResourceKey resourceKey)
                    throws SearchEngineException
Description copied from class: AbstractConcurrentTransactionProcessor
Base classes should implement this. Behaviour should be the same as AbstractConcurrentTransactionProcessor.get(org.compass.core.spi.ResourceKey).

Specified by:
doGet in class AbstractConcurrentTransactionProcessor
Throws:
SearchEngineException

prepareBeforeAsyncDirtyOperation

protected void prepareBeforeAsyncDirtyOperation(TransactionJob job)
                                         throws SearchEngineException
Just open an index writer here on the same calling thread so we maintain ordering of operations as well as no need for double check if we created it or not using expensive global locking.

Specified by:
prepareBeforeAsyncDirtyOperation in class AbstractConcurrentTransactionProcessor
Throws:
SearchEngineException

getOrCreateIndexWriter

protected IndexWriter getOrCreateIndexWriter(String subIndex)
                                      throws IOException
Throws:
IOException


Copyright (c) 2004-2009 The Compass Project.