com.atlassian.jira.util.index
Interface IndexLifecycleManager

All Superinterfaces:
Shutdown, Sized
All Known Subinterfaces:
IssueIndexManager, SharedEntityIndexManager
All Known Implementing Classes:
BulkOnlyIndexManager, CompositeIndexLifecycleManager, DefaultIndexManager, DefaultSharedEntityIndexManager, MemoryIndexManager, MockIndexLifecycleManager

@PublicApi
public interface IndexLifecycleManager
extends Sized, Shutdown

Manage an index lifecycle.

Since:
v3.13

Method Summary
 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 isIndexAvailable()
          Whether this index is available.
 boolean isIndexConsistent()
           
 boolean isIndexingEnabled()
          Deprecated. since v6.3.3 Use isIndexAvailable()
 long optimize()
          Optimize the underlying indexes.
 long reIndexAll(Context context)
          Reindex everything.
 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
 void shutdown()
          Shuts down the indexing manager and closes its resources (if any).
 int size()
           
 
Methods inherited from interface com.atlassian.jira.util.collect.Sized
isEmpty
 

Method Detail

reIndexAll

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.

reIndexAllIssuesInBackground

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.
Since:
v5.2

reIndexAllIssuesInBackground

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.
Since:
v6.2

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

Specified by:
shutdown in interface Shutdown

activate

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

activate

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

deactivate

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


isIndexingEnabled

boolean isIndexingEnabled()
Deprecated. since v6.3.3 Use isIndexAvailable()

Returns:
whether this index is enabled or true if all sub indexes are enabled

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.
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 interface Sized
Returns:
how many Entities will be re-indexed by reIndexAll(Context)


Copyright © 2002-2014 Atlassian. All Rights Reserved.