|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.node.index.AbstractReindexComponent
public abstract class AbstractReindexComponent
Abstract helper for reindexing.
AbstractReindexComponent.reindexImpl()
,
AbstractReindexComponent.getIndexerWriteLock()
,
AbstractReindexComponent.isShuttingDown()
Nested Class Summary | |
---|---|
static class |
AbstractReindexComponent.InIndex
|
protected static interface |
AbstractReindexComponent.ReindexNodeCallback
Callback to notify caller whenever a node has been indexed |
static class |
AbstractReindexComponent.ReindexTerminatedException
Marker exception to neatly handle VM-driven termination of a reindex |
Field Summary | |
---|---|
protected FullTextSearchIndexer |
ftsIndexer
the FTS indexer that we will prompt to pick up on any un-indexed text |
protected Indexer |
indexer
the component to index the node hierarchy |
protected NodeDAO |
nodeDAO
the component giving direct access to transaction instances |
protected org.alfresco.service.cmr.repository.NodeService |
nodeService
the component giving direct access to store instances |
protected org.alfresco.service.cmr.search.SearchService |
searcher
the component providing searches of the indexed nodes |
protected TransactionServiceImpl |
transactionService
provides transactions to atomically index each missed transaction |
Constructor Summary | |
---|---|
AbstractReindexComponent()
|
Method Summary | |
---|---|
protected java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock |
getIndexerWriteLock()
Convenience method to get a common write lock. |
boolean |
isIgnorableStore(org.alfresco.service.cmr.repository.StoreRef storeRef)
Find out if a store is ignored by the indexing code |
protected boolean |
isShuttingDown()
|
AbstractReindexComponent.InIndex |
isTxnPresentInIndex(Transaction txn)
Determines if a given transaction is definitely in the index or not. |
AbstractReindexComponent.InIndex |
isTxnPresentInIndex(Transaction txn,
boolean readThrough)
|
void |
reindex()
If this object is currently busy, then it just nothing |
protected abstract void |
reindexImpl()
Perform the actual work. |
protected void |
reindexTransaction(long txnId,
AbstractReindexComponent.ReindexNodeCallback callback,
boolean isFull)
Perform a full reindexing of the given transaction on the current thread. |
protected void |
reindexTransaction(java.lang.Long txnId,
boolean isFull)
|
protected void |
reindexTransactionAsynchronously(java.util.List txnIds,
boolean isFull)
Performs indexing off the current thread, which may return quickly if there are threads immediately available in the thread pool. |
protected boolean |
requireTransaction()
Determines if calls to AbstractReindexComponent.reindexImpl() should be wrapped in a transaction or not. |
void |
setAuthenticationComponent(AuthenticationComponent authenticationComponent)
No longer required |
void |
setFtsIndexer(FullTextSearchIndexer ftsIndexer)
|
void |
setIndexer(Indexer indexer)
|
void |
setNodeDAO(NodeDAO nodeDAO)
|
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
|
void |
setSearcher(org.alfresco.service.cmr.search.SearchService searcher)
|
void |
setShutdown(boolean shutdown)
Programmatically notify a reindex thread to terminate |
void |
setStoreProtocolsToIgnore(java.util.List storeProtocolsToIgnore)
|
void |
setStoresToIgnore(java.util.List storesToIgnore)
|
void |
setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
|
void |
setThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor threadPoolExecutor)
Set the thread pool to use when doing asynchronous reindexing. |
void |
setTransactionService(TransactionServiceImpl transactionService)
Set the low-level transaction component to use |
protected void |
waitForAsynchronousReindexing()
Wait for all asynchronous indexing to finish before returning. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected TransactionServiceImpl transactionService
protected Indexer indexer
protected FullTextSearchIndexer ftsIndexer
protected org.alfresco.service.cmr.search.SearchService searcher
protected org.alfresco.service.cmr.repository.NodeService nodeService
protected NodeDAO nodeDAO
Constructor Detail |
---|
public AbstractReindexComponent()
Method Detail |
---|
protected java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock getIndexerWriteLock()
public void setShutdown(boolean shutdown)
shutdown
- true to shutdown, false to resetprotected boolean isShuttingDown()
shut down
public void setAuthenticationComponent(AuthenticationComponent authenticationComponent)
public void setTransactionService(TransactionServiceImpl transactionService)
transactionComponent
- provide transactions to index each missed transactionpublic void setIndexer(Indexer indexer)
indexer
- the indexer that will be indexpublic void setFtsIndexer(FullTextSearchIndexer ftsIndexer)
ftsIndexer
- the FTS background indexerpublic void setSearcher(org.alfresco.service.cmr.search.SearchService searcher)
searcher
- component providing index searchespublic void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService
- provides information about nodes for indexingpublic void setNodeDAO(NodeDAO nodeDAO)
nodeDAO
- provides access to transaction-related queriespublic void setThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor threadPoolExecutor)
threadPoolExecutor
- a pre-configured thread pool for the reindex workpublic void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
public void setStoreProtocolsToIgnore(java.util.List storeProtocolsToIgnore)
storeProtocolsToIgnore
- a list of store protocols that will be ignored
by the index check code e.g. 'deleted' in 'deleted://MyStore'public void setStoresToIgnore(java.util.List storesToIgnore)
storesToIgnore
- a list of store references that will be ignored
by the index check code e.g. 'test://TestOne'public boolean isIgnorableStore(org.alfresco.service.cmr.repository.StoreRef storeRef)
storeRef
- the store to check
protected boolean requireTransaction()
AbstractReindexComponent.reindexImpl()
should be wrapped in a transaction or not.
The default is true.
protected abstract void reindexImpl()
public final void reindex()
reindex
in interface IndexRecovery
public AbstractReindexComponent.InIndex isTxnPresentInIndex(Transaction txn)
txn
- a specific transaction
public AbstractReindexComponent.InIndex isTxnPresentInIndex(Transaction txn, boolean readThrough)
protected void reindexTransaction(java.lang.Long txnId, boolean isFull)
protected void reindexTransaction(long txnId, AbstractReindexComponent.ReindexNodeCallback callback, boolean isFull)
txnId
- the transaction identifiercallback
- the callback to notify of each node indexed
AbstractReindexComponent.ReindexTerminatedException
- if the VM is shutdown during the reindexprotected void reindexTransactionAsynchronously(java.util.List txnIds, boolean isFull)
Commits are guaranteed to occur in the order in which this reindex jobs are added to the queue.
#reindexTransaction(long)
,
AbstractReindexComponent.waitForAsynchronousReindexing()
protected void waitForAsynchronousReindexing()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |