|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.lucene.engine.transaction.support.AbstractTransactionProcessor
org.compass.core.lucene.engine.transaction.support.AbstractSearchTransactionProcessor
org.compass.core.lucene.engine.transaction.mt.MTTransactionProcessor
public class MTTransactionProcessor
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.
| Field Summary |
|---|
| Fields inherited from class org.compass.core.lucene.engine.transaction.support.AbstractTransactionProcessor |
|---|
indexManager, mapping, searchEngine, searchEngineFactory |
| Constructor Summary | |
|---|---|
MTTransactionProcessor(MTTransactionProcessorFactory transactionProcessorFactory,
LuceneSearchEngine searchEngine)
|
|
| 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. |
protected IndexWriter |
getOrCreateIndexWriter(String subIndex)
Opens a new index writer if there is no open one already for the provided sub index. |
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. |
| 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 |
|---|
public MTTransactionProcessor(MTTransactionProcessorFactory transactionProcessorFactory,
LuceneSearchEngine searchEngine)
| Method Detail |
|---|
public String getName()
TransactionProcessor
public void begin()
throws SearchEngineException
TransactionProcessor
SearchEngineException
public void prepare()
throws SearchEngineException
TransactionProcessor
SearchEngineException
public void commit(boolean onePhase)
throws SearchEngineException
TransactionProcessoronePhase 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.
SearchEngineException
public void rollback()
throws SearchEngineException
TransactionProcessor
SearchEngineException
public LuceneSearchEngineHits find(LuceneSearchEngineQuery query)
throws SearchEngineException
TransactionProcessor
SearchEngineException
public Resource[] get(ResourceKey resourceKey)
throws SearchEngineException
TransactionProcessorNote, should usually only return one resource.
SearchEngineException
public LuceneSearchEngineInternalSearch internalSearch(String[] subIndexes,
String[] aliases)
throws SearchEngineException
TransactionProcessor
SearchEngineException
public void flush()
throws SearchEngineException
TransactionProcessor
SearchEngineException
public void flushCommit(String... aliases)
throws SearchEngineException
TransactionProcessor
SearchEngineException
public void create(InternalResource resource)
throws SearchEngineException
TransactionProcessor
SearchEngineException
public void update(InternalResource resource)
throws SearchEngineException
TransactionProcessor
SearchEngineException
public void delete(ResourceKey resourceKey)
throws SearchEngineException
TransactionProcessor
SearchEngineException
public void delete(LuceneSearchEngineQuery query)
throws SearchEngineException
TransactionProcessor
SearchEngineException
protected IndexWriter getOrCreateIndexWriter(String subIndex)
throws SearchEngineException
Thread safe.
SearchEngineException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||