com.atlassian.jira.issue.index
Class DefaultIndexManager

java.lang.Object
  extended bycom.atlassian.jira.issue.index.DefaultIndexManager
All Implemented Interfaces:
IssueIndexManager
Direct Known Subclasses:
BulkOnlyIndexManager, MemoryIndexManager

public class DefaultIndexManager
extends Object
implements IssueIndexManager


Field Summary
static org.apache.lucene.analysis.Analyzer ANALYZER_FOR_INDEXING
           
static org.apache.lucene.analysis.Analyzer ANALYZER_FOR_SEARCHING
           
static String COMMENTS_SUBDIR
           
static String ISSUES_SUBDIR
           
static String PLUGINS_SUBDIR
           
 
Constructor Summary
DefaultIndexManager()
           
DefaultIndexManager(ApplicationProperties applicationProperties, IssueIndexer issueIndexer)
           
 
Method Summary
 long activate(String indexPath, com.atlassian.johnson.event.Event appEvent)
          Activates search indexes.
 void deactivate()
          Deactivates indexing (as happens from the admin page) and removes index directories.
 void deactivate(String filePath)
          Deactivate a specific search index and remove its directory.
 void deIndex(org.ofbiz.core.entity.GenericValue entity)
          Remove an issue from the search index.
 org.apache.lucene.store.Directory getCommentDirectory()
          Get the 'comments' index subtree's directory.
 String getCommentPath()
          The specific path of the comments index
protected  String getFilePath()
          Return the path beneath which the different index directories are stored
protected  org.apache.lucene.index.IndexReader getIndexReader(String path)
          Obtain an IndexReader
protected  org.apache.lucene.index.IndexWriter getIndexWriter(String path, boolean create)
          Obtain an IndexWriter for and optionally create.
 org.apache.lucene.store.Directory getIssueDirectory()
          Get the 'issues' index subtree's directory.
 String getIssuePath()
          The specific path of the issue index
 boolean isBusy()
          If any indexing operations are taking place.
 void reIndex(org.ofbiz.core.entity.GenericValue entity)
          Reindex an issue (eg.
 long reIndexAll()
          Reindex all issues.
 long reIndexAll(com.atlassian.johnson.event.Event event)
          Reindex all issues.
 long reIndexIssueObjects(Collection issueObjects)
          Reindex a set of issues.
 long reIndexIssues(Collection issues)
          Reindex a set of issues (GenericValues).
protected  long reIndexIssues(Collection issues, boolean recreateIndex, boolean deIndexIssues, boolean optimiseIfNeeded, com.atlassian.johnson.event.Event event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANALYZER_FOR_SEARCHING

public static final org.apache.lucene.analysis.Analyzer ANALYZER_FOR_SEARCHING

ANALYZER_FOR_INDEXING

public static final org.apache.lucene.analysis.Analyzer ANALYZER_FOR_INDEXING

COMMENTS_SUBDIR

public static final String COMMENTS_SUBDIR
See Also:
Constant Field Values

ISSUES_SUBDIR

public static final String ISSUES_SUBDIR
See Also:
Constant Field Values

PLUGINS_SUBDIR

public static final String PLUGINS_SUBDIR
See Also:
Constant Field Values
Constructor Detail

DefaultIndexManager

public DefaultIndexManager()

DefaultIndexManager

public DefaultIndexManager(ApplicationProperties applicationProperties,
                           IssueIndexer issueIndexer)
Method Detail

isBusy

public boolean isBusy()
Description copied from interface: IssueIndexManager
If any indexing operations are taking place.

Specified by:
isBusy in interface IssueIndexManager

deactivate

public void deactivate(String filePath)
                throws Exception
Description copied from interface: IssueIndexManager
Deactivate a specific search index and remove its directory.

Specified by:
deactivate in interface IssueIndexManager
Throws:
Exception

deactivate

public void deactivate()
                throws Exception
Description copied from interface: IssueIndexManager
Deactivates indexing (as happens from the admin page) and removes index directories.

Specified by:
deactivate in interface IssueIndexManager
Throws:
Exception

activate

public long activate(String indexPath,
                     com.atlassian.johnson.event.Event appEvent)
              throws Exception
Description copied from interface: IssueIndexManager
Activates search indexes.

Specified by:
activate in interface IssueIndexManager
Parameters:
indexPath - Root path to the search index.
appEvent - Optional reindex Event that the caller has set (see source in IndexAdminImpl.doActivate()) or null.
Returns:
Reindex time in ms
Throws:
Exception

reIndexAll

public long reIndexAll()
                throws IndexException
Description copied from interface: IssueIndexManager
Reindex all issues.

Specified by:
reIndexAll in interface IssueIndexManager
Returns:
The number of milliseconds taken to reindex everything, or -1 if not indexing
Throws:
IndexException

reIndexAll

public long reIndexAll(com.atlassian.johnson.event.Event event)
                throws IndexException
Description copied from interface: IssueIndexManager
Reindex all issues.

Specified by:
reIndexAll in interface IssueIndexManager
Parameters:
event - Reindex Event that the caller has set (see source in IndexAdminImpl.doActivate()).
Returns:
Reindex time in ms.
Throws:
IndexException

reIndexIssues

public long reIndexIssues(Collection issues)
                   throws IndexException
Description copied from interface: IssueIndexManager
Reindex a set of issues (GenericValues). Use IssueIndexManager.reIndexIssueObjects(Collection) instead when possible.

Specified by:
reIndexIssues in interface IssueIndexManager
Parameters:
issues - The Issue GenericValues to reindex.
Returns:
Reindex time in ms.
Throws:
IndexException

reIndexIssueObjects

public long reIndexIssueObjects(Collection issueObjects)
                         throws IndexException
Description copied from interface: IssueIndexManager
Reindex a set of issues.

Specified by:
reIndexIssueObjects in interface IssueIndexManager
Parameters:
issueObjects - Set of Issues to reindex.
Returns:
Reindex time in ms.
Throws:
IndexException

reIndexIssues

protected long reIndexIssues(Collection issues,
                             boolean recreateIndex,
                             boolean deIndexIssues,
                             boolean optimiseIfNeeded,
                             com.atlassian.johnson.event.Event event)
                      throws IndexException
Throws:
IndexException

reIndex

public void reIndex(org.ofbiz.core.entity.GenericValue entity)
             throws IndexException
Description copied from interface: IssueIndexManager
Reindex an issue (eg. after field updates).

Specified by:
reIndex in interface IssueIndexManager
Throws:
IndexException

deIndex

public void deIndex(org.ofbiz.core.entity.GenericValue entity)
             throws IndexException
Description copied from interface: IssueIndexManager
Remove an issue from the search index.

Specified by:
deIndex in interface IssueIndexManager
Throws:
IndexException

getIssuePath

public String getIssuePath()
The specific path of the issue index

Specified by:
getIssuePath in interface IssueIndexManager

getCommentPath

public String getCommentPath()
The specific path of the comments index

Specified by:
getCommentPath in interface IssueIndexManager

getIssueDirectory

public org.apache.lucene.store.Directory getIssueDirectory()
Description copied from interface: IssueIndexManager
Get the 'issues' index subtree's directory.

Specified by:
getIssueDirectory in interface IssueIndexManager

getCommentDirectory

public org.apache.lucene.store.Directory getCommentDirectory()
Description copied from interface: IssueIndexManager
Get the 'comments' index subtree's directory.

Specified by:
getCommentDirectory in interface IssueIndexManager

getFilePath

protected String getFilePath()
Return the path beneath which the different index directories are stored


getIndexReader

protected org.apache.lucene.index.IndexReader getIndexReader(String path)
                                                      throws IndexException
Obtain an IndexReader

Throws:
IndexException

getIndexWriter

protected org.apache.lucene.index.IndexWriter getIndexWriter(String path,
                                                             boolean create)
                                                      throws IndexException
Obtain an IndexWriter for and optionally create.

Throws:
IndexException


Copyright © 2002-2006 Atlassian. All Rights Reserved.