Package com.atlassian.jira.util.index
Interface IndexLifecycleManager
- All Known Subinterfaces:
IssueIndexManager
,SharedEntityIndexManager
- All Known Implementing Classes:
BulkOnlyIndexManager
,CompositeIndexLifecycleManager
,DefaultIndexManager
,DefaultSharedEntityIndexManager
Manage an index lifecycle.
- Since:
- v3.13
-
Method Summary
Modifier and TypeMethodDescriptionlong
Activates search indexes.long
Activates search indexes.void
De-activates indexing (as happens from the admin page) and removes index directories.boolean
Whether this index is available.boolean
long
optimize()
Optimize the underlying indexes.long
reIndexAll
(Context context) Deprecated.long
reIndexAll
(Context context, IssueIndexingParams issueIndexingParams) Reindex indexes defined by theIssueIndexingParams
.long
reIndexAllIssuesInBackground
(Context context) Reindex everything, but don't stop the world Comments and change history will not be reindexed.long
reIndexIssuesInBackground
(Context context, IssueIndexingParams issueIndexingParams) Reindex everything, but don't stop the worldvoid
shutdown()
Shuts down the indexing manager and closes its resources (if any).int
size()
-
Method Details
-
reIndexAll
Deprecated.Reindex everything.- Parameters:
context
- used to report progress back to the user or to the logs. Must not be null.- Returns:
- Reindex time in ms.
-
reIndexAll
Reindex indexes defined by theIssueIndexingParams
.- 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.
- Since:
- v6.4
-
reIndexAllIssuesInBackground
Reindex everything, but don't stop the world Comments and change history will not be reindexed.- Parameters:
context
- used to report progress back to the user or to the logs. Must not be null.- Returns:
- Reindex time in ms.
- Since:
- v5.2
-
reIndexIssuesInBackground
Reindex everything, but don't stop the world- 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.
- Since:
- v6.4
-
optimize
long optimize()Optimize the underlying indexes. Make the subsequent searching more efficient.- 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.
- Throws:
IndexException
- if the indexes are seriously in trouble
-
shutdown
void shutdown()Shuts down the indexing manager and closes its resources (if any). -
activate
Activates search indexes. This will rebuild the indexes.- Parameters:
context
- used to report progress back to the user or to the logs. Must not be null.- Returns:
- Reindex time in ms
-
activate
Activates search indexes.- 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
-
deactivate
void deactivate()De-activates indexing (as happens from the admin page) and removes index directories. -
isIndexAvailable
boolean isIndexAvailable()Whether 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.- Returns:
- Whether this index is available.
- Since:
- v6.3.3
-
isIndexConsistent
boolean isIndexConsistent()- 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 thatfalse
is also returned if the index is not available . - Since:
- 5.2
-
getAllIndexPaths
Collection<String> getAllIndexPaths()- Returns:
- a collection of Strings that map to all paths that contain Lucene indexes. Must not be null.
-
size
int size()- Specified by:
size
in interfaceSized
- Returns:
- how many Entities will be re-indexed by
reIndexAll(Context)
-
reIndexAll(com.atlassian.jira.task.context.Context, com.atlassian.jira.issue.index.IssueIndexingParams)
instead.