com.atlassian.jira.util.index
Interface IndexLifecycleManager

All Superinterfaces:
Sized
All Known Subinterfaces:
IssueIndexManager, SharedEntityIndexManager
All Known Implementing Classes:
BulkOnlyIndexManager, DefaultIndexManager, DefaultSharedEntityIndexManager, IndexLifecycleManager.Composite, MemoryIndexManager

public interface IndexLifecycleManager
extends Sized

Manage an index lifecycle.

Since:
v3.13

Nested Class Summary
static class IndexLifecycleManager.Composite
          Convenience class for managing known IndexManagers and calling them all.
 
Method Summary
 long activate(String indexPath, Context context)
          Activates search indexes.
 void deactivate()
          De-activates indexing (as happens from the admin page) and removes index directories.
 Collection getAllIndexPaths()
           
 boolean isIndexingEnabled()
           
 long optimize()
          Optimize the underlying indexes.
 long reIndexAll(Context context)
          Reindex everything.
 void shutdown()
          Shuts down the indexing manager and closes its resources (if any).
 int size()
           
 

Method Detail

reIndexAll

long reIndexAll(Context context)
                throws IndexException
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.
Throws:
IndexException

optimize

long optimize()
              throws IndexException
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

long activate(String indexPath,
              Context context)
              throws Exception
Activates search indexes.

Parameters:
indexPath - Root path to the search index.
context - used to report progress back to the user or to the logs. Must not be null.
Returns:
Reindex time in ms
Throws:
Exception

deactivate

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

Throws:
Exception

isIndexingEnabled

boolean isIndexingEnabled()
Returns:
whether this index is enabled or true if all sub indexes are enabled

getAllIndexPaths

Collection 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-2009 Atlassian. All Rights Reserved.