public class

CompositeIndexLifecycleManager

extends Object
implements IndexLifecycleManager
java.lang.Object
   ↳ com.atlassian.jira.util.index.CompositeIndexLifecycleManager

Class Overview

Convenience class for managing known IndexManagers and calling them all.

Summary

Public Constructors
CompositeIndexLifecycleManager(IssueIndexManager issueIndexManager, SharedEntityIndexManager sharedEntityIndexManager, IndexingCounterManager indexingCounterManager)
Public Methods
long activate(Context context)
Activates search indexes.
long activate(Context context, boolean reindex)
Activates search indexes.
void deactivate()
De-activates indexing (as happens from the admin page) and removes index directories.
Collection<String> getAllIndexPaths()
boolean isEmpty()
boolean isIndexAvailable()
Whether this index is available.
boolean isIndexConsistent()
boolean isIndexingEnabled()
long optimize()
Optimize the underlying indexes.
long reIndexAll(Context context)
Reindex everything.
long reIndexAll(Context context, IssueIndexingParams issueIndexingParams)
Reindex indexes defined by the IssueIndexingParams.
long reIndexAllIssuesInBackground(Context context)
Reindex everything, but don't stop the world Comments and change history will not be reindexed.
long reIndexAllIssuesInBackground(Context context, boolean reIndexComments, boolean reIndexChangeHistory)
Reindex everything, but don't stop the world
long reIndexIssuesInBackground(Context context, IssueIndexingParams issueIndexingParams)
Reindex everything, but don't stop the world
void shutdown()
Shuts down the indexing manager and closes its resources (if any).
int size()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.util.Shutdown
From interface com.atlassian.jira.util.collect.Sized
From interface com.atlassian.jira.util.index.IndexLifecycleManager

Public Constructors

public CompositeIndexLifecycleManager (IssueIndexManager issueIndexManager, SharedEntityIndexManager sharedEntityIndexManager, IndexingCounterManager indexingCounterManager)

Public Methods

public long activate (Context context)

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

public long activate (Context context, boolean reindex)

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

public void deactivate ()

De-activates indexing (as happens from the admin page) and removes index directories.

public Collection<String> getAllIndexPaths ()

public boolean isEmpty ()

public 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.

public boolean isIndexConsistent ()

public boolean isIndexingEnabled ()

public 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.

public long reIndexAll (Context context)

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.

public long reIndexAll (Context context, IssueIndexingParams issueIndexingParams)

Reindex indexes defined by the IssueIndexingParams.

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.

public long reIndexAllIssuesInBackground (Context context)

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.

public long reIndexAllIssuesInBackground (Context context, boolean reIndexComments, boolean reIndexChangeHistory)

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.
reIndexComments Also reindex all the issue comments.
reIndexChangeHistory Also reindex the issue change history.
Returns
  • Reindex time in ms.

public long reIndexIssuesInBackground (Context context, IssueIndexingParams issueIndexingParams)

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.

public void shutdown ()

Shuts down the indexing manager and closes its resources (if any).

public int size ()