org.alfresco.repo.node.index
Class FullIndexRecoveryComponent

java.lang.Object
  extended by org.alfresco.repo.node.index.AbstractReindexComponent
      extended by org.alfresco.repo.node.index.FullIndexRecoveryComponent
All Implemented Interfaces:
IndexRecovery

public class FullIndexRecoveryComponent
extends AbstractReindexComponent

Component to check and recover the indexes. By default, the server is put into read-only mode during the reindex process in order to prevent metadata changes. This is not critical and can be switched off if the server is required immediately.

See Also:
FullIndexRecoveryComponent.RecoveryMode

Nested Class Summary
static class FullIndexRecoveryComponent.RecoveryMode
           
 
Nested classes/interfaces inherited from class org.alfresco.repo.node.index.AbstractReindexComponent
AbstractReindexComponent.InIndex, AbstractReindexComponent.ReindexNodeCallback, AbstractReindexComponent.ReindexTerminatedException
 
Field Summary
 
Fields inherited from class org.alfresco.repo.node.index.AbstractReindexComponent
ftsIndexer, indexer, nodeDAO, nodeService, searcher, transactionService
 
Constructor Summary
FullIndexRecoveryComponent()
           recoveryMode: VALIDATE stopOnError: true
 
Method Summary
protected  AbstractReindexComponent.InIndex areAllTxnsInEndSample(java.util.List txns)
           
protected  AbstractReindexComponent.InIndex areTxnsInStartSample(java.util.List txns)
           
protected  void reindexImpl()
          Perform the actual work.
 void reindexTransaction(long txnId)
          Perform full reindexing of the given transaction.
 void setIndexTracker(IndexTransactionTracker indexTracker)
          Set the tracker that will be used for AUTO mode.
 void setLockServer(boolean lockServer)
          Set this on to put the server into READ-ONLY mode for the duration of the index recovery.
 void setMaxTransactionsPerLuceneCommit(int maxTransactionsPerLuceneCommit)
          Set the number of transactions to process per Lucene write.
 void setRecoveryMode(java.lang.String recoveryMode)
          Set the type of recovery to perform.
 void setStopOnError(boolean stopOnError)
          Set whether a full rebuild should stop in the event of encoutering an error.
 
Methods inherited from class org.alfresco.repo.node.index.AbstractReindexComponent
getIndexerWriteLock, isIgnorableStore, isShuttingDown, isTxnPresentInIndex, isTxnPresentInIndex, reindex, reindexTransaction, reindexTransaction, reindexTransactionAsynchronously, requireTransaction, setAuthenticationComponent, setFtsIndexer, setIndexer, setNodeDAO, setNodeService, setSearcher, setShutdown, setStoreProtocolsToIgnore, setStoresToIgnore, setTenantService, setThreadPoolExecutor, setTransactionService, waitForAsynchronousReindexing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FullIndexRecoveryComponent

public FullIndexRecoveryComponent()

Method Detail

setRecoveryMode

public void setRecoveryMode(java.lang.String recoveryMode)
Set the type of recovery to perform. Default is to validate the indexes only.

Parameters:
recoveryMode - one of the FullIndexRecoveryComponent.RecoveryMode values

setMaxTransactionsPerLuceneCommit

public void setMaxTransactionsPerLuceneCommit(int maxTransactionsPerLuceneCommit)
Set the number of transactions to process per Lucene write. Larger values generate less contention on the Lucene IndexInfo files.


setLockServer

public void setLockServer(boolean lockServer)
Set this on to put the server into READ-ONLY mode for the duration of the index recovery. The default is true, i.e. the server will be locked against further updates.

Parameters:
lockServer - true to force the server to be read-only

setIndexTracker

public void setIndexTracker(IndexTransactionTracker indexTracker)
Set the tracker that will be used for AUTO mode.

Parameters:
indexTracker - an index tracker component

setStopOnError

public void setStopOnError(boolean stopOnError)
Set whether a full rebuild should stop in the event of encoutering an error. The default is to stop reindexing, and this will lead to the server startup failing when index recovery mode is FULL. Sometimes, it is necessary to start the server up regardless of any errors with particular nodes.

Parameters:
stopOnError - true to stop reindexing when an error is encountered.

reindexImpl

protected void reindexImpl()
Description copied from class: AbstractReindexComponent
Perform the actual work. This method will be called as the system user and within an existing transaction. This thread will only ever be accessed by a single thread per instance.

Specified by:
reindexImpl in class AbstractReindexComponent

areAllTxnsInEndSample

protected AbstractReindexComponent.InIndex areAllTxnsInEndSample(java.util.List txns)
Returns:
Returns false if any one of the transactions aren't in the index.

areTxnsInStartSample

protected AbstractReindexComponent.InIndex areTxnsInStartSample(java.util.List txns)

reindexTransaction

public void reindexTransaction(long txnId)
Perform full reindexing of the given transaction. A read-only transaction is created if one doesn't already exist.

Parameters:
txnId - the transaction identifier


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.