org.compass.core.lucene.engine.transaction
Interface TransactionProcessor

All Known Implementing Classes:
AbstractConcurrentTransactionProcessor, AbstractJobBasedTransactionProcessor, AbstractSearchTransactionProcessor, AbstractTransactionProcessor, AsyncTransactionProcessor, LuceneTransactionProcessor, MTTransactionProcessor, ReadCommittedTransactionProcessor, SearchTransactionProcessor, TerracottaTransactionProcessor

public interface TransactionProcessor

A Lucene transaction interface. All Lucene based transactions must implement the interface for the LuceneSearchEngine to work with them.

Author:
kimchy

Method Summary
 void begin()
          Begin the transaction.
 void commit(boolean onePhase)
          Commit the trnasction.
 void create(InternalResource resource)
          Creates a resource.
 void delete(LuceneSearchEngineQuery query)
          Delets everything that match the given query.
 void delete(ResourceKey resourceKey)
          Deletes a resource based on the resource key.
 LuceneSearchEngineHits find(LuceneSearchEngineQuery query)
          Perform a search for the given query and returns the hits for it.
 void flush()
          Flush changes.
 void flushCommit(String... aliases)
          Flush changes and make them visible for other transactions.
 Resource[] get(ResourceKey resourceKey)
          Returns the resources tha match a resource key.
 String getName()
          Retuns the name of this transaction processor.
 LuceneSearchEngineInternalSearch internalSearch(String[] subIndexes, String[] aliases)
          Performs an internal search operation.
 void prepare()
          Prepare the transaction for commit.
 void rollback()
          Rollback the transaction.
 void update(InternalResource resource)
          Updates a resource.
 

Method Detail

getName

String getName()
Retuns the name of this transaction processor.


begin

void begin()
           throws SearchEngineException
Begin the transaction.

Throws:
SearchEngineException

prepare

void prepare()
             throws SearchEngineException
Prepare the transaction for commit.

Throws:
SearchEngineException

commit

void commit(boolean onePhase)
            throws SearchEngineException
Commit the trnasction. If onePhase is set to true then should perform both the prepare phase and the commit phase. If it is set to false then just needs to perform the second phase of the commit process.

Throws:
SearchEngineException

rollback

void rollback()
              throws SearchEngineException
Rollback the transaction.

Throws:
SearchEngineException

flush

void flush()
           throws SearchEngineException
Flush changes. Note, the implementation needs to strive for changes not to be visible to other transactions.

Throws:
SearchEngineException

flushCommit

void flushCommit(String... aliases)
                 throws SearchEngineException
Flush changes and make them visible for other transactions. Note, operations performed up until the flush commit was called might not be able to roll back.

Throws:
SearchEngineException

create

void create(InternalResource resource)
            throws SearchEngineException
Creates a resource.

Throws:
SearchEngineException

update

void update(InternalResource resource)
            throws SearchEngineException
Updates a resource.

Throws:
SearchEngineException

delete

void delete(ResourceKey resourceKey)
            throws SearchEngineException
Deletes a resource based on the resource key.

Throws:
SearchEngineException

delete

void delete(LuceneSearchEngineQuery query)
            throws SearchEngineException
Delets everything that match the given query.

Throws:
SearchEngineException

find

LuceneSearchEngineHits find(LuceneSearchEngineQuery query)
                            throws SearchEngineException
Perform a search for the given query and returns the hits for it.

Throws:
SearchEngineException

get

Resource[] get(ResourceKey resourceKey)
               throws SearchEngineException
Returns the resources tha match a resource key.

Note, should usually only return one resource.

Throws:
SearchEngineException

internalSearch

LuceneSearchEngineInternalSearch internalSearch(String[] subIndexes,
                                                String[] aliases)
                                                throws SearchEngineException
Performs an internal search operation.

Throws:
SearchEngineException


Copyright (c) 2004-2009 The Compass Project.