org.compass.core.lucene.engine.transaction
Class BatchInsertTransaction
java.lang.Object
org.compass.core.lucene.engine.transaction.AbstractTransaction
org.compass.core.lucene.engine.transaction.BatchInsertTransaction
- All Implemented Interfaces:
- LuceneSearchEngineTransaction
public class BatchInsertTransaction
- extends AbstractTransaction
A batch update transaction management. Only support save (add) operations.
Find and delete operations throws an exception. The transaction is very fast
when adding new resources, note that if a resource with the save id already
exists, we will have two resources with the same id.
The Batch Transaction support uses Lucene directly, and the Lucene settings
apply and affect greatly on the performance of the batch indexing. Among them
are the LuceneEnvironment.SearchEngineIndex.MAX_BUFFERED_DOCS,
LuceneEnvironment.SearchEngineIndex.MAX_MERGE_DOCS,
LuceneEnvironment.SearchEngineIndex.MERGE_FACTOR.
- Author:
- kimchy
| Methods inherited from class org.compass.core.lucene.engine.transaction.AbstractTransaction |
begin, closeDelegateClosed, commit, configure, create, delete, find, getResourceMapping, internalSearch, isDirty, prepare, rollback |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BatchInsertTransaction
public BatchInsertTransaction()
doBegin
protected void doBegin()
throws SearchEngineException
- Specified by:
doBegin in class AbstractTransaction
- Throws:
SearchEngineException
doRollback
protected void doRollback()
throws SearchEngineException
- Specified by:
doRollback in class AbstractTransaction
- Throws:
SearchEngineException
doPrepare
protected void doPrepare()
throws SearchEngineException
- Specified by:
doPrepare in class AbstractTransaction
- Throws:
SearchEngineException
doCommit
protected void doCommit(boolean onePhase)
throws SearchEngineException
- Specified by:
doCommit in class AbstractTransaction
- Throws:
SearchEngineException
flush
public void flush()
throws SearchEngineException
- Description copied from interface:
LuceneSearchEngineTransaction
- Supported only in batch insert transacitons.
- Throws:
SearchEngineException
doCreate
protected void doCreate(InternalResource resource)
throws SearchEngineException
- Specified by:
doCreate in class AbstractTransaction
- Throws:
SearchEngineException
doDelete
protected void doDelete(ResourceKey resourceKey)
throws SearchEngineException
- Specified by:
doDelete in class AbstractTransaction
- Throws:
SearchEngineException
doFind
protected SearchEngineHits doFind(LuceneSearchEngineQuery query)
throws SearchEngineException
- Specified by:
doFind in class AbstractTransaction
- Throws:
SearchEngineException
find
public Resource[] find(ResourceKey resourceKey)
throws SearchEngineException
- Throws:
SearchEngineException
doInternalSearch
protected SearchEngineInternalSearch doInternalSearch(String[] subIndexes,
String[] aliases)
throws SearchEngineException
- Specified by:
doInternalSearch in class AbstractTransaction
- Throws:
SearchEngineException
Copyright (c) 2004-2006 The Compass Project.