|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.alfresco.repo.search.impl.lucene.AbstractLuceneIndexerAndSearcherFactory
public abstract class AbstractLuceneIndexerAndSearcherFactory
This class is resource manager LuceneIndexers and LuceneSearchers. It supports two phase commit inside XA transactions and outside transactions it provides thread local transaction support. TODO: Provide pluggable support for a transaction manager TODO: Integrate with Spring transactions
| Nested Class Summary | |
|---|---|
static class |
AbstractLuceneIndexerAndSearcherFactory.LuceneIndexBackupComponent
This component is able to safely perform backups of the Lucene indexes while the server is running. |
static class |
AbstractLuceneIndexerAndSearcherFactory.LuceneIndexBackupJob
Job that lock uses the AbstractLuceneIndexerAndSearcherFactory.LuceneIndexBackupComponent to perform safe backups of the Lucene indexes. |
| Nested classes/interfaces inherited from interface org.alfresco.repo.search.impl.lucene.LuceneIndexerAndSearcher |
|---|
LuceneIndexerAndSearcher.WithAllWriteLocksWork |
| Field Summary | |
|---|---|
protected TenantService |
tenantService
|
| Fields inherited from interface javax.transaction.xa.XAResource |
|---|
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY |
| Constructor Summary | |
|---|---|
AbstractLuceneIndexerAndSearcherFactory()
Private constructor for the singleton TODO: FIt in with IOC |
|
| Method Summary | |
|---|---|
void |
commit()
Commit the transaction |
void |
commit(javax.transaction.xa.Xid xid,
boolean onePhase)
|
protected abstract LuceneIndexer |
createIndexer(StoreRef storeRef,
java.lang.String deltaId)
Encapsulate creating an indexer |
static void |
deleteDirectory(java.io.File directory)
|
java.lang.Object |
doWithAllWriteLocks(LuceneIndexerAndSearcher.WithAllWriteLocksWork lockWork)
|
void |
end(javax.transaction.xa.Xid xid,
int flag)
|
void |
flush()
Do any indexing that may be pending on behalf of the current transaction. |
void |
forget(javax.transaction.xa.Xid xid)
|
protected abstract java.util.List |
getAllStores()
|
BulkLoader |
getBulkLoader()
Get preloader - may be null if preloading is not supported |
long |
getCommitLockTimeout()
Get the commit lock timout. |
MLAnalysisMode |
getDefaultMLIndexAnalysisMode()
The default mode for analysing ML text during index. |
MLAnalysisMode |
getDefaultMLSearchAnalysisMode()
The default mode for analysis of ML text during search. |
LuceneIndexer |
getIndexer(StoreRef storeRef)
Get an indexer for the store to use in the current transaction for this thread of control. |
int |
getIndexerBatchSize()
The batch size in which to group flushes of the index. |
int |
getIndexerMaxFieldLength()
Get the max number of tokens in the field |
java.lang.String |
getIndexRootLocation()
The path to the index location |
java.lang.String |
getLockDirectory()
Get the directory where any lock files are written (by default there are none) |
int |
getMaxDocIdCacheSize()
How many document ids to cache (-ve => unbounded) |
int |
getMaxDocsForInMemoryMerge()
Max doc number that will merged in memory (and not on disk) |
int |
getMaxDocumentCacheSize()
How many documents to cache (-ve => unbounded) |
int |
getMaxIsCategoryCacheSize()
How many categories to cache (-ve => unbounded) |
int |
getMaxLinkAspectCacheSize()
How many link aspects to cache (-ve => unbounded) |
int |
getMaxParentCacheSize()
How many parents to cache (-ve => unbounded) |
int |
getMaxPathCacheSize()
How many paths to cache (-ve => unbounded) |
long |
getMaxTransformationTime()
Get the max time for an atomic transform |
int |
getMaxTypeCacheSize()
How many types to cache (-ve => unbounded) |
int |
getMergerMaxMergeDocs()
Lucene merger config |
int |
getMergerMergeFactor()
Lucene merger config |
int |
getMergerMinMergeDocs()
Lucene merger config |
int |
getMergerTargetIndexCount()
Target index count. |
int |
getMergerTargetOverlayCount()
Target overlays (will apply deletions and create indexes if over this limit) |
int |
getQueryMaxClauses()
The maximum numbr of sub-queries the can be generated out of wild card expansion etc |
QueryRegisterComponent |
getQueryRegister()
Get the query register. |
LuceneSearcher |
getSearcher(StoreRef storeRef,
boolean searchDelta)
Encapsulate creating a searcher over the main index |
protected abstract LuceneSearcher |
getSearcher(StoreRef storeRef,
LuceneIndexer indexer)
Get a searcher over the index and the current delta |
int |
getTermIndexInterval()
Lucene term index interval |
java.util.concurrent.ThreadPoolExecutor |
getThreadPoolExecutor()
Get the thread pool for index merging etc |
int |
getTransactionTimeout()
|
boolean |
getUseNioMemoryMapping()
Use the nio memory mapping (work arounf for bugs with some JVMs) |
long |
getWriteLockTimeout()
Get the write lock timeout |
int |
getWriterMaxMergeDocs()
Lucene writer config |
int |
getWriterMergeFactor()
Lucene writer config |
int |
getWriterMinMergeDocs()
Lucene writer config |
boolean |
isCacheEnabled()
Is caching enabled for each index fragment? |
boolean |
isSameRM(javax.transaction.xa.XAResource xar)
|
static void |
main(java.lang.String[] args)
|
int |
prepare()
Prepare the transaction TODO: Store prepare results |
int |
prepare(javax.transaction.xa.Xid xid)
|
javax.transaction.xa.Xid[] |
recover(int arg0)
|
void |
rollback()
Roll back the transaction |
void |
rollback(javax.transaction.xa.Xid xid)
|
void |
setBulkLoader(BulkLoader bulkLoader)
|
void |
setCacheEnabled(boolean cacheEnabled)
|
void |
setCommitLockTimeout(long timeout)
Set the lucene commit lock timeout (no longer used with lucene 2.1) |
void |
setDefaultMLIndexAnalysisMode(MLAnalysisMode mode)
Set the ML analysis mode at index time. |
void |
setDefaultMLSearchAnalysisMode(MLAnalysisMode mode)
Set the ML analysis mode at search time |
void |
setIndexerBatchSize(int indexerBatchSize)
Set the batch six to use for background indexing |
void |
setIndexerMaxFieldLength(int indexerMaxFieldLength)
Set the max field length. |
void |
setIndexRootLocation(java.lang.String indexRootLocation)
Set the directory that contains the indexes |
void |
setLockDirectory(java.lang.String lockDirectory)
Set the lock dir - just to make sure - this should no longer be used. |
void |
setLockPollInterval(long time)
Set the lock poll interval in ms |
void |
setMaxAtomicTransformationTime(long maxAtomicTransformationTime)
Set the maximum average transformation time allowed to a transformer in order to have the transformation performed in the current transaction. |
void |
setMaxDocIdCacheSize(int maxDocIdCacheSize)
|
void |
setMaxDocsForInMemoryMerge(int maxDocsForInMemoryMerge)
|
void |
setMaxDocumentCacheSize(int maxDocumentCacheSize)
|
void |
setMaxIsCategoryCacheSize(int maxIsCategoryCacheSize)
|
void |
setMaxLinkAspectCacheSize(int maxLinkAspectCacheSize)
|
void |
setMaxParentCacheSize(int maxParentCacheSize)
|
void |
setMaxPathCacheSize(int maxPathCacheSize)
|
void |
setMaxTypeCacheSize(int maxTypeCacheSize)
|
void |
setMergerMaxMergeDocs(int mergerMaxMergeDocs)
|
void |
setMergerMergeFactor(int mergerMergeFactor)
|
void |
setMergerMinMergeDocs(int mergerMinMergeDocs)
|
void |
setMergerTargetIndexCount(int mergerTargetIndexCount)
|
void |
setMergerTargetOverlayCount(int mergerTargetOverlayCount)
|
void |
setQueryMaxClauses(int queryMaxClauses)
Set the max number of queries in a llucen boolean query |
void |
setQueryRegister(QueryRegisterComponent queryRegister)
Set the query register |
void |
setTenantService(TenantService tenantService)
Set the tenant service |
void |
setTermIndexInterval(int termIndexInterval)
|
void |
setThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor threadPoolExecutor)
|
boolean |
setTransactionTimeout(int timeout)
|
void |
setUseNioMemoryMapping(boolean useNioMemoryMapping)
|
void |
setWriteLockTimeout(long timeout)
Set the lucene write lock timeout |
void |
setWriterMaxMergeDocs(int writerMaxMergeDocs)
|
void |
setWriterMergeFactor(int writerMergeFactor)
|
void |
setWriterMinMergeDocs(int writerMinMergeDocs)
|
void |
start(javax.transaction.xa.Xid xid,
int flag)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected TenantService tenantService
| Constructor Detail |
|---|
public AbstractLuceneIndexerAndSearcherFactory()
| Method Detail |
|---|
public void setIndexRootLocation(java.lang.String indexRootLocation)
indexRootLocation - public void setTenantService(TenantService tenantService)
tenantService - public void setQueryRegister(QueryRegisterComponent queryRegister)
queryRegister - public QueryRegisterComponent getQueryRegister()
public void setMaxAtomicTransformationTime(long maxAtomicTransformationTime)
maxAtomicTransformationTime - the maximum average time that a text transformation may take in order to be performed atomically.public long getMaxTransformationTime()
public BulkLoader getBulkLoader()
LuceneConfig
getBulkLoader in interface LuceneConfigpublic void setBulkLoader(BulkLoader bulkLoader)
public LuceneIndexer getIndexer(StoreRef storeRef)
throws IndexerException
getIndexer in interface IndexerAndSearcherstoreRef - -
the id of the store
IndexerException
protected abstract LuceneIndexer createIndexer(StoreRef storeRef,
java.lang.String deltaId)
storeRef - deltaId -
public LuceneSearcher getSearcher(StoreRef storeRef,
boolean searchDelta)
throws SearcherException
getSearcher in interface IndexerAndSearchersearchDelta - -
serach the in progress transaction as well as the main index
(this is ignored for searches that do full text)
SearcherException
protected abstract LuceneSearcher getSearcher(StoreRef storeRef,
LuceneIndexer indexer)
throws SearcherException
storeRef - deltaId -
SearcherException
public void commit(javax.transaction.xa.Xid xid,
boolean onePhase)
throws javax.transaction.xa.XAException
commit in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
public void end(javax.transaction.xa.Xid xid,
int flag)
throws javax.transaction.xa.XAException
end in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
public void forget(javax.transaction.xa.Xid xid)
throws javax.transaction.xa.XAException
forget in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
public int getTransactionTimeout()
throws javax.transaction.xa.XAException
getTransactionTimeout in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
public boolean isSameRM(javax.transaction.xa.XAResource xar)
throws javax.transaction.xa.XAException
isSameRM in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
public int prepare(javax.transaction.xa.Xid xid)
throws javax.transaction.xa.XAException
prepare in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
public javax.transaction.xa.Xid[] recover(int arg0)
throws javax.transaction.xa.XAException
recover in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
public void rollback(javax.transaction.xa.Xid xid)
throws javax.transaction.xa.XAException
rollback in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
public boolean setTransactionTimeout(int timeout)
throws javax.transaction.xa.XAException
setTransactionTimeout in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
public void start(javax.transaction.xa.Xid xid,
int flag)
throws javax.transaction.xa.XAException
start in interface javax.transaction.xa.XAResourcejavax.transaction.xa.XAException
public void commit()
throws IndexerException
commit in interface LuceneIndexerAndSearcherIndexerException
public int prepare()
throws IndexerException
prepare in interface LuceneIndexerAndSearcherIndexerExceptionpublic void rollback()
rollback in interface LuceneIndexerAndSearcherpublic void flush()
IndexerAndSearcher
flush in interface IndexerAndSearcherpublic java.lang.String getIndexRootLocation()
LuceneConfig
getIndexRootLocation in interface LuceneConfigpublic int getIndexerBatchSize()
LuceneConfig
getIndexerBatchSize in interface LuceneConfigpublic void setIndexerBatchSize(int indexerBatchSize)
indexerBatchSize - public java.lang.String getLockDirectory()
public void setLockDirectory(java.lang.String lockDirectory)
LuceneConfig
setLockDirectory in interface LuceneConfigpublic int getQueryMaxClauses()
LuceneConfig
getQueryMaxClauses in interface LuceneConfigpublic void setQueryMaxClauses(int queryMaxClauses)
queryMaxClauses - public void setWriteLockTimeout(long timeout)
timeout - public void setCommitLockTimeout(long timeout)
timeout - public long getCommitLockTimeout()
public long getWriteLockTimeout()
public void setLockPollInterval(long time)
time - public int getIndexerMaxFieldLength()
getIndexerMaxFieldLength in interface LuceneConfigpublic void setIndexerMaxFieldLength(int indexerMaxFieldLength)
indexerMaxFieldLength - public java.util.concurrent.ThreadPoolExecutor getThreadPoolExecutor()
LuceneConfig
getThreadPoolExecutor in interface LuceneConfigpublic void setThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor threadPoolExecutor)
public MLAnalysisMode getDefaultMLIndexAnalysisMode()
LuceneConfig
getDefaultMLIndexAnalysisMode in interface LuceneConfigpublic void setDefaultMLIndexAnalysisMode(MLAnalysisMode mode)
mode - public MLAnalysisMode getDefaultMLSearchAnalysisMode()
LuceneConfig
getDefaultMLSearchAnalysisMode in interface LuceneConfigpublic void setDefaultMLSearchAnalysisMode(MLAnalysisMode mode)
mode - public int getMaxDocIdCacheSize()
LuceneConfig
getMaxDocIdCacheSize in interface LuceneConfigpublic void setMaxDocIdCacheSize(int maxDocIdCacheSize)
public int getMaxDocsForInMemoryMerge()
LuceneConfig
getMaxDocsForInMemoryMerge in interface LuceneConfigpublic void setMaxDocsForInMemoryMerge(int maxDocsForInMemoryMerge)
public int getMaxDocumentCacheSize()
LuceneConfig
getMaxDocumentCacheSize in interface LuceneConfigpublic void setMaxDocumentCacheSize(int maxDocumentCacheSize)
public int getMaxIsCategoryCacheSize()
LuceneConfig
getMaxIsCategoryCacheSize in interface LuceneConfigpublic void setMaxIsCategoryCacheSize(int maxIsCategoryCacheSize)
public int getMaxLinkAspectCacheSize()
LuceneConfig
getMaxLinkAspectCacheSize in interface LuceneConfigpublic void setMaxLinkAspectCacheSize(int maxLinkAspectCacheSize)
public int getMaxParentCacheSize()
LuceneConfig
getMaxParentCacheSize in interface LuceneConfigpublic void setMaxParentCacheSize(int maxParentCacheSize)
public int getMaxPathCacheSize()
LuceneConfig
getMaxPathCacheSize in interface LuceneConfigpublic void setMaxPathCacheSize(int maxPathCacheSize)
public int getMaxTypeCacheSize()
LuceneConfig
getMaxTypeCacheSize in interface LuceneConfigpublic void setMaxTypeCacheSize(int maxTypeCacheSize)
public int getMergerMaxMergeDocs()
LuceneConfig
getMergerMaxMergeDocs in interface LuceneConfigpublic void setMergerMaxMergeDocs(int mergerMaxMergeDocs)
public int getMergerMergeFactor()
LuceneConfig
getMergerMergeFactor in interface LuceneConfigpublic void setMergerMergeFactor(int mergerMergeFactor)
public int getMergerMinMergeDocs()
LuceneConfig
getMergerMinMergeDocs in interface LuceneConfigpublic void setMergerMinMergeDocs(int mergerMinMergeDocs)
public int getMergerTargetIndexCount()
LuceneConfig
getMergerTargetIndexCount in interface LuceneConfigpublic void setMergerTargetIndexCount(int mergerTargetIndexCount)
public int getMergerTargetOverlayCount()
LuceneConfig
getMergerTargetOverlayCount in interface LuceneConfigpublic void setMergerTargetOverlayCount(int mergerTargetOverlayCount)
public int getTermIndexInterval()
LuceneConfig
getTermIndexInterval in interface LuceneConfigpublic void setTermIndexInterval(int termIndexInterval)
public boolean getUseNioMemoryMapping()
LuceneConfig
getUseNioMemoryMapping in interface LuceneConfigpublic void setUseNioMemoryMapping(boolean useNioMemoryMapping)
public int getWriterMaxMergeDocs()
LuceneConfig
getWriterMaxMergeDocs in interface LuceneConfigpublic void setWriterMaxMergeDocs(int writerMaxMergeDocs)
public int getWriterMergeFactor()
LuceneConfig
getWriterMergeFactor in interface LuceneConfigpublic void setWriterMergeFactor(int writerMergeFactor)
public int getWriterMinMergeDocs()
LuceneConfig
getWriterMinMergeDocs in interface LuceneConfigpublic void setWriterMinMergeDocs(int writerMinMergeDocs)
public boolean isCacheEnabled()
LuceneConfig
isCacheEnabled in interface LuceneConfigpublic void setCacheEnabled(boolean cacheEnabled)
protected abstract java.util.List getAllStores()
public java.lang.Object doWithAllWriteLocks(LuceneIndexerAndSearcher.WithAllWriteLocksWork lockWork)
doWithAllWriteLocks in interface LuceneIndexerAndSearcher
public static void main(java.lang.String[] args)
throws java.io.IOException
java.io.IOException
public static void deleteDirectory(java.io.File directory)
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||