public abstract class AbstractReindexComponent extends java.lang.Object implements IndexRecovery
| Modifier and Type | Class and Description |
|---|---|
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
|
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
AbstractReindexComponent() |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
doInRetryingTransaction(RetryingTransactionHelper.RetryingTransactionCallback callback,
boolean isReadThrough)
To allow for possible 'read committed' behaviour in some databases, where a node that previously existed during a
transaction can disappear from existence, we treat InvalidNodeRefExceptions as concurrency conditions.
|
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.
|
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
protected java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock getIndexerWriteLock()
public void setShutdown(boolean shutdown)
shutdown - true to shutdown, false to resetprotected boolean isShuttingDown()
shut downpublic 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 checkprotected boolean requireTransaction()
AbstractReindexComponent.reindexImpl() should be wrapped in a transaction or not.
The default is true.protected abstract void reindexImpl()
protected java.lang.Object doInRetryingTransaction(RetryingTransactionHelper.RetryingTransactionCallback callback, boolean isReadThrough)
public final void reindex()
reindex in interface IndexRecoverypublic AbstractReindexComponent.InIndex isTxnPresentInIndex(Transaction txn)
txn - a specific transactionpublic 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 indexedAbstractReindexComponent.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()
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.