Package com.atlassian.jira.sharing.index
Class DefaultSharedEntityIndexManager
java.lang.Object
com.atlassian.jira.sharing.index.DefaultSharedEntityIndexManager
- All Implemented Interfaces:
BackupContributor,SharedEntityIndexManager,Sized,IndexLifecycleManager,Shutdown
Default IndexManager for
shared entities- Since:
- v3.13
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultSharedEntityIndexManager(SharedEntityIndexer indexer, SearchRequestManager searchRequestManager, PortalPageManager portalPageManager, FileFactory fileFactory, ApplicationProperties applicationProperties, IndexBackupContributorsManager indexBackupContributorsManager) -
Method Summary
Modifier and TypeMethodDescriptionlongActivates search indexes.longActivates search indexes.voidcontributeToBackup(BackupBuilder backupBuilder) Contribute a set of files to the givenbackupBuilderto include them in the backup being created when this method was called.voidDe-activates indexing (as happens from the admin page) and removes index directories.booleanisEmpty()booleanWhether this index is available.booleanlongoptimize()Optimize the underlying indexes.longlongreIndexAll(Context context) Reindex everything.longreIndexAll(Context context, IssueIndexingParams issueIndexingParams) Reindex indexes defined by theIssueIndexingParams.longreIndexAllIssuesInBackground(Context context) Reindex everything, but don't stop the world Comments and change history will not be reindexed.longreIndexIssuesInBackground(Context context, IssueIndexingParams issueIndexingParams) Reindex everything, but don't stop the worldlongreIndexSharedEntities(Context context, IssueIndexingParams issueIndexingParams, Set<SharedEntity.TypeDescriptor> sharedEntityTypes) Reindex the specified shared entity types.voidshutdown()Shuts down the indexing manager and closes its resources (if any).intsize()toString()
-
Constructor Details
-
Method Details
-
reIndexAll
Description copied from interface:IndexLifecycleManagerReindex everything.- Specified by:
reIndexAllin interfaceIndexLifecycleManager- Parameters:
context- used to report progress back to the user or to the logs. Must not be null.- Returns:
- Reindex time in ms.
-
reIndexAll
Description copied from interface:IndexLifecycleManagerReindex indexes defined by theIssueIndexingParams.- Specified by:
reIndexAllin interfaceIndexLifecycleManager- Parameters:
context- used to report progress back to the user or to the logs. Must not be null.issueIndexingParams- indexes to reindex.- Returns:
- Reindex time in ms.
-
reIndexAll
- Throws:
IndexException
-
reIndexAllIssuesInBackground
Description copied from interface:IndexLifecycleManagerReindex everything, but don't stop the world Comments and change history will not be reindexed.- Specified by:
reIndexAllIssuesInBackgroundin interfaceIndexLifecycleManager- Parameters:
context- used to report progress back to the user or to the logs. Must not be null.- Returns:
- Reindex time in ms.
-
reIndexIssuesInBackground
Description copied from interface:IndexLifecycleManagerReindex everything, but don't stop the world- Specified by:
reIndexIssuesInBackgroundin interfaceIndexLifecycleManager- Parameters:
context- used to report progress back to the user or to the logs. Must not be null.issueIndexingParams- determines witch related objects should be indexed together with issue.- Returns:
- Reindex time in ms.
-
optimize
public long optimize()Description copied from interface:IndexLifecycleManagerOptimize the underlying indexes. Make the subsequent searching more efficient.- Specified by:
optimizein interfaceIndexLifecycleManager- Returns:
- the amount of time in millis this method took (because you are too lazy to time me), 0 if indexing is not enabled or -1 if we cannot obtain the index writeLock.
-
shutdown
public void shutdown()Description copied from interface:IndexLifecycleManagerShuts down the indexing manager and closes its resources (if any).- Specified by:
shutdownin interfaceIndexLifecycleManager- Specified by:
shutdownin interfaceShutdown
-
activate
Description copied from interface:IndexLifecycleManagerActivates search indexes.- Specified by:
activatein interfaceIndexLifecycleManager- Parameters:
context- used to report progress back to the user or to the logs. Must not be null.reindex- reindex after activation.- Returns:
- Reindex time in ms
-
activate
Description copied from interface:IndexLifecycleManagerActivates search indexes. This will rebuild the indexes.- Specified by:
activatein interfaceIndexLifecycleManager- Parameters:
context- used to report progress back to the user or to the logs. Must not be null.- Returns:
- Reindex time in ms
-
deactivate
public void deactivate()Description copied from interface:IndexLifecycleManagerDe-activates indexing (as happens from the admin page) and removes index directories.- Specified by:
deactivatein interfaceIndexLifecycleManager
-
isIndexAvailable
public boolean isIndexAvailable()Description copied from interface:IndexLifecycleManagerWhether this index is available. The index is not available if the index is being rebuilt or recovered. In a clustered environment this reflects only the state on the local node.- Specified by:
isIndexAvailablein interfaceIndexLifecycleManager- Returns:
- Whether this index is available.
-
isIndexConsistent
public boolean isIndexConsistent()- Specified by:
isIndexConsistentin interfaceIndexLifecycleManager- Returns:
- the result of a simple consistency check that compares the index state to
the current number of issues. A background re-index should not be attempted
when this returns
false. Note thatfalseis also returned if the index is not available .
-
getAllIndexPaths
- Specified by:
getAllIndexPathsin interfaceIndexLifecycleManager- Returns:
- a collection of Strings that map to all paths that contain Lucene indexes. Must not be null.
-
size
public int size()- Specified by:
sizein interfaceIndexLifecycleManager- Specified by:
sizein interfaceSized- Returns:
- how many Entities will be re-indexed by
IndexLifecycleManager.reIndexAll(Context)
-
isEmpty
public boolean isEmpty() -
toString
-
contributeToBackup
Description copied from interface:BackupContributorContribute a set of files to the givenbackupBuilderto include them in the backup being created when this method was called.- Specified by:
contributeToBackupin interfaceBackupContributor- Parameters:
backupBuilder- builder of the backup being created at the time of call. All existing and nonempty files passed to its accept method will be included. The builder may not be reusable and the reference should not be stored outside the scope of this method
-