Class DefaultIndexManager

java.lang.Object
com.atlassian.jira.issue.index.DefaultIndexManager
All Implemented Interfaces:
InternalIndexingService, IssueIndexingService, IssueIndexManager, Sized, IndexLifecycleManager, Shutdown
Direct Known Subclasses:
BulkOnlyIndexManager

public class DefaultIndexManager extends Object implements IssueIndexManager, InternalIndexingService
  • Field Details

    • 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
  • Constructor Details

  • Method Details

    • getAnalyzerForSearching

      public org.apache.lucene.analysis.Analyzer getAnalyzerForSearching()
      Description copied from interface: IssueIndexManager
      Returns an Analyzer for searching.
      Specified by:
      getAnalyzerForSearching in interface IssueIndexManager
      Returns:
      an analyzer for searching
    • getAnalyzerForIndexing

      public org.apache.lucene.analysis.Analyzer getAnalyzerForIndexing()
      Description copied from interface: IssueIndexManager
      Returns an Analyzer for indexing.
      Specified by:
      getAnalyzerForIndexing in interface IssueIndexManager
      Returns:
      an analyzer for indexing.
    • deactivate

      public void deactivate()
      Description copied from interface: IndexLifecycleManager
      De-activates indexing (as happens from the admin page) and removes index directories.
      Specified by:
      deactivate in interface IndexLifecycleManager
    • activate

      public long activate(Context context)
      Description copied from interface: IndexLifecycleManager
      Activates search indexes. This will rebuild the indexes.
      Specified by:
      activate in interface IndexLifecycleManager
      Parameters:
      context - used to report progress back to the user or to the logs. Must not be null.
      Returns:
      Reindex time in ms
    • activate

      public long activate(Context context, boolean reindex)
      Description copied from interface: IndexLifecycleManager
      Activates search indexes.
      Specified by:
      activate in interface IndexLifecycleManager
      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
    • isIndexAvailable

      public boolean isIndexAvailable()
      Description copied from interface: IndexLifecycleManager
      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.
      Specified by:
      isIndexAvailable in interface IndexLifecycleManager
      Returns:
      Whether this index is available.
    • reIndexAll

      public long reIndexAll() throws IndexException
      Description copied from interface: IssueIndexManager
      Reindex all issues.
      Specified by:
      reIndexAll in interface IssueIndexingService
      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(Context context)
      Description copied from interface: IndexLifecycleManager
      Reindex everything.
      Specified by:
      reIndexAll in interface IndexLifecycleManager
      Parameters:
      context - used to report progress back to the user or to the logs. Must not be null.
      Returns:
      Reindex time in ms.
    • reIndexAll

      public long reIndexAll(Context context, boolean useBackgroundIndexing)
    • reIndexAll

      public long reIndexAll(Context context, boolean useBackgroundIndexing, boolean notifyCluster)
      Description copied from interface: IssueIndexManager
      Reindex all issues.
      Specified by:
      reIndexAll in interface IssueIndexingService
      Specified by:
      reIndexAll in interface IssueIndexManager
      Parameters:
      context - used to report progress back to the user or to the logs. Must not be null
      useBackgroundIndexing - whether to index in the background or not. If the useBackgroundReindexing option is set to true, then all related fields will not be reindexed.
      notifyCluster - whether or not to notify the cluster about reindexing all
      Returns:
      Reindex time in ms.
    • reIndexAll

      public long reIndexAll(Context context, boolean useBackgroundIndexing, boolean reIndexComments, boolean reIndexChangeHistory, boolean notifyCluster)
      Description copied from interface: IssueIndexManager
      Reindex all issues. If the useBackgroundReindexing option is set to true, then only the basic issue information will be reindexed, unless the reIndexComments or reIndexChangeHistory parameters are also set. This is considered the normal mode for background re-indexing and is sufficient to correct the index for changes in the system configuration, but not for changes to the indexing language. If useBackgroundReindexing is set to false, than everything is always reindexed.
      Specified by:
      reIndexAll in interface IssueIndexManager
      Parameters:
      context - used to report progress back to the user or to the logs. Must not be null
      useBackgroundIndexing - whether to index in the background or not
      reIndexComments - Also reindex all the issue comments. Only relevant for background reindex operations.
      reIndexChangeHistory - Also reindex the issue change history. Only relevant for background reindex operations.
      notifyCluster - whether or not to notify the cluster about reindexing all
      Returns:
      Reindex time in ms.
    • reIndexAll

      public long reIndexAll(Context context, IssueIndexingParams issueIndexingParams)
      Description copied from interface: IndexLifecycleManager
      Reindex indexes defined by the IssueIndexingParams.
      Specified by:
      reIndexAll in interface IndexLifecycleManager
      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.
    • reIndexAll

      public long reIndexAll(Context context, boolean useBackgroundIndexing, IssueIndexingParams issueIndexingParams, boolean notifyCluster)
      Description copied from interface: IssueIndexManager
      Reindex all issues. If the useBackgroundReindexing option is set to true, then only the basic issue information will be reindexed, unless the indexing parameters are also set. This is considered the normal mode for background re-indexing and is sufficient to correct the index for changes in the system configuration, but not for changes to the indexing language. If useBackgroundReindexing is set to false, than everything is always reindexed.
      Specified by:
      reIndexAll in interface IssueIndexingService
      Specified by:
      reIndexAll in interface IssueIndexManager
      Parameters:
      context - used to report progress back to the user or to the logs. Must not be null
      useBackgroundIndexing - whether to index in the background or not
      issueIndexingParams - determines witch related objects should be indexed together with issues. Only relevant for background reindex operations.
      notifyCluster - whether or not to notify the cluster about reindexing all
      Returns:
      Reindex time in ms.
    • withReindexLock

      public boolean withReindexLock(Runnable runnable)
      This method takes a runnable that is run under the 'stop the world' reindex lock. It is used here in preference to a Guava function in order to avoid introducing more Guava into the API, which limits our ability to update the library. The runnable is executed in the current thread.
      Specified by:
      withReindexLock in interface IssueIndexManager
      Parameters:
      runnable - The runnable to be executed
      Returns:
      true if the lock was acquired and the runnable was run, false if the lock could not be acquired and the code was not run
    • reIndexAllIssuesInBackground

      public long reIndexAllIssuesInBackground(Context context)
      Description copied from interface: IndexLifecycleManager
      Reindex everything, but don't stop the world Comments and change history will not be reindexed.
      Specified by:
      reIndexAllIssuesInBackground in interface IndexLifecycleManager
      Parameters:
      context - used to report progress back to the user or to the logs. Must not be null.
      Returns:
      Reindex time in ms.
    • reIndexIssuesInBackground

      public long reIndexIssuesInBackground(Context context, IssueIndexingParams issueIndexingParams)
      Description copied from interface: IndexLifecycleManager
      Reindex everything, but don't stop the world
      Specified by:
      reIndexIssuesInBackground in interface IndexLifecycleManager
      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.
    • reIndexIssues

      public long reIndexIssues(Collection<org.ofbiz.core.entity.GenericValue> 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
    • reIndexIssues

      protected long reIndexIssues(Collection<org.ofbiz.core.entity.GenericValue> issues, IssueIndexingParams issueIndexingParams) throws IndexException
      Throws:
      IndexException
    • reIndexIssueObjects

      public long reIndexIssueObjects(Collection<? extends Issue> issueObjects) throws IndexException
      Description copied from interface: IssueIndexManager
      Reindex a set of issues.
      Specified by:
      reIndexIssueObjects in interface IssueIndexingService
      Specified by:
      reIndexIssueObjects in interface IssueIndexManager
      Parameters:
      issueObjects - Set of Issues to reindex.
      Returns:
      Reindex time in ms.
      Throws:
      IndexException
    • reIndexIssueObjects

      public long reIndexIssueObjects(Collection<? extends Issue> issueObjects, boolean reIndexComments, boolean reIndexChangeHistory) 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
    • reIndexIssueObjects

      public long reIndexIssueObjects(Collection<? extends Issue> issueObjects, IssueIndexingParams issueIndexingParams) throws IndexException
      Description copied from interface: IssueIndexManager
      Reindex a set of issues.
      Specified by:
      reIndexIssueObjects in interface IssueIndexingService
      Specified by:
      reIndexIssueObjects in interface IssueIndexManager
      Parameters:
      issueObjects - Set of Issues to reindex.
      issueIndexingParams - Determines witch related objects should be indexed together with issues.
      Returns:
      Reindex time in ms.
      Throws:
      IndexException
    • reIndexIssueObjects

      public long reIndexIssueObjects(Collection<? extends Issue> issueObjects, boolean reIndexComments, boolean reIndexChangeHistory, boolean shouldReplicate)
      Description copied from interface: IssueIndexManager
      Reindex a set of issues.
      Specified by:
      reIndexIssueObjects in interface IssueIndexManager
      Parameters:
      issueObjects - Set of Issues to reindex.
      reIndexComments - whether to reindex the comments or not
      reIndexChangeHistory - whether to reindex changeHistory or not
      shouldReplicate - whether or not the index changes should be replicated to the other nodes in the cluster.
      Returns:
      Reindex time in ms.
    • reIndexIssueObjects

      public long reIndexIssueObjects(Collection<? extends Issue> issueObjects, IssueIndexingParams issueIndexingParams, boolean shouldReplicate)
      Description copied from interface: IssueIndexManager
      Reindex a set of issues.
      Specified by:
      reIndexIssueObjects in interface IssueIndexingService
      Specified by:
      reIndexIssueObjects in interface IssueIndexManager
      Parameters:
      issueObjects - Set of Issues to reindex.
      issueIndexingParams - Determines witch related objects should be indexed together with issues.
      shouldReplicate - whether or not the index changes should be replicated to the other nodes in the cluster.
      Returns:
      Reindex time in ms.
    • deIndex

      public void deIndex(Project project, boolean shouldReplicate)
      Description copied from interface: IssueIndexingService
      Deindexing issues from a given project
      Specified by:
      deIndex in interface IssueIndexingService
      Parameters:
      project - project object
      shouldReplicate - whether or not the index changes should be replicated to the other nodes in the cluster.
    • deIndexComments

      public void deIndexComments(Set<WithId> commentsToDeIndex, boolean shouldReplicate)
      Description copied from interface: IssueIndexingService
      Remove a set of comments from the search index.
      Specified by:
      deIndexComments in interface IssueIndexingService
      Parameters:
      commentsToDeIndex - set of WithIds to deIndex.
      shouldReplicate - whether or not the index changes should be replicated to the other nodes in the cluster.
    • deIndexWorklogs

      public void deIndexWorklogs(Set<WithId> worklogsToDeIndex, boolean shouldReplicate)
      Description copied from interface: IssueIndexingService
      Remove a set of worklogs from the search index.
      Specified by:
      deIndexWorklogs in interface IssueIndexingService
      Parameters:
      worklogsToDeIndex - set of WithIds to deIndex.
      shouldReplicate - whether or not the index changes should be replicated to the other nodes in the cluster.
    • reIndex

      public void reIndex(Issue issue) throws IndexException
      Description copied from interface: IssueIndexManager
      Reindex an issue (eg. after field updates).
      Specified by:
      reIndex in interface IssueIndexingService
      Specified by:
      reIndex in interface IssueIndexManager
      Throws:
      IndexException
    • reIndex

      public void reIndex(Issue issue, boolean reIndexComments, boolean reIndexChangeHistory)
      Description copied from interface: IssueIndexManager
      Reindex an issue (eg. after field updates).
      Specified by:
      reIndex in interface IssueIndexManager
    • reIndex

      public void reIndex(Issue issue, IssueIndexingParams issueIndexingParams)
      Description copied from interface: IssueIndexManager
      Reindex an issue (eg. after field updates).
      Specified by:
      reIndex in interface IssueIndexingService
      Specified by:
      reIndex in interface IssueIndexManager
    • reIndex

      public void reIndex(org.ofbiz.core.entity.GenericValue issueGV) throws IndexException
      Description copied from interface: IssueIndexManager
      Reindex an issue (eg. after field updates).
      Specified by:
      reIndex in interface IssueIndexManager
      Throws:
      IndexException
    • hold

      public void hold()
      Description copied from interface: IssueIndexManager
      Temporarily suspend indexing on this thread. All index requests will be queued and processed when release is called.
      Specified by:
      hold in interface IssueIndexManager
    • isHeld

      public boolean isHeld()
      Description copied from interface: IssueIndexManager
      Return true if the index is held.
      Specified by:
      isHeld in interface IssueIndexManager
    • release

      public long release() throws IndexException
      Description copied from interface: IssueIndexManager
      Release indexing on this thread. All queued index requests will be processed.
      Specified by:
      release in interface IssueIndexManager
      Returns:
      Reindex time in ms.
      Throws:
      IndexException - if an error occurs
    • reIndexIssues

      public long reIndexIssues(IssuesIterable issuesIterable, Context context) throws IndexException
      Description copied from interface: IssueIndexManager
      Reindex a list of issues, passing an optional event that will be set progress
      Specified by:
      reIndexIssues in interface IssueIndexingService
      Specified by:
      reIndexIssues in interface IssueIndexManager
      Parameters:
      issuesIterable - IssuesIterable
      context - used to report progress back to the user or to the logs. Must not be null.
      Returns:
      Reindex time in ms.
      Throws:
      IndexException
    • reIndexIssues

      public long reIndexIssues(IssuesIterable issuesIterable, Context context, boolean reIndexComments, boolean reIndexChangeHistory) throws IndexException
      Description copied from interface: IssueIndexManager
      Reindex a list of issues, passing an optional event that will be set progress. This method can optionally also index the comments and change history.
      Specified by:
      reIndexIssues in interface IssueIndexManager
      Parameters:
      issuesIterable - IssuesIterable
      context - used to report progress back to the user or to the logs. Must not be null.
      reIndexComments - a boolean indicating whether to index issue comments
      reIndexChangeHistory - a boolean indicating whether to index issue change history
      Returns:
      Reindex time in ms.
      Throws:
      IndexException
    • reIndexIssues

      public long reIndexIssues(IssuesIterable issuesIterable, Context context, IssueIndexingParams issueIndexingParams)
      Description copied from interface: IssueIndexManager
      Reindex a list of issues, passing an optional event that will be set progress. This method can optionally also index the comments and change history.
      Specified by:
      reIndexIssues in interface IssueIndexingService
      Specified by:
      reIndexIssues in interface IssueIndexManager
      Parameters:
      issuesIterable - IssuesIterable
      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.
    • reIndexIssues

      public long reIndexIssues(IssuesIterable issuesIterable, Context context, IssueIndexingParams issueIndexingParams, boolean shouldReplicate)
      Description copied from interface: IssueIndexingService
      Reindex a list of issues, passing an optional Context for providing status updates. This method can optionally also index the comments and change history. It also allows the caller to specify whether or not the indexing changes should be replicated to the rest of the cluster.
      Specified by:
      reIndexIssues in interface IssueIndexingService
      Parameters:
      issuesIterable - IssuesIterable of issues to reindex
      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.
      shouldReplicate - whether or not the index changes should be replicated to the other nodes in the cluster.
      Returns:
      Reindex time in ms, -1 if there's an error.
    • reIndexComments

      public long reIndexComments(Collection<Comment> comments) throws IndexException
      Description copied from interface: IssueIndexManager
      Reindexes a collection of comments.
      Specified by:
      reIndexComments in interface IssueIndexingService
      Specified by:
      reIndexComments in interface IssueIndexManager
      Parameters:
      comments - a collection of Comment
      Throws:
      IndexException
    • reIndexComments

      public long reIndexComments(Collection<Comment> comments, Context context) throws IndexException
      Description copied from interface: IssueIndexManager
      Reindexes a collection of comments.
      Specified by:
      reIndexComments in interface IssueIndexingService
      Specified by:
      reIndexComments in interface IssueIndexManager
      Parameters:
      comments - a collection of Comment
      context - used to report progress back to the user or to the logs. Must not be null.
      Throws:
      IndexException
    • reIndexComments

      public long reIndexComments(Collection<Comment> comments, Context context, boolean shouldReplicate) throws IndexException
      Description copied from interface: IssueIndexManager
      Reindexes a collection of comments.
      Specified by:
      reIndexComments in interface IssueIndexingService
      Specified by:
      reIndexComments in interface IssueIndexManager
      Parameters:
      comments - a collection of Comment
      context - used to report progress back to the user or to the logs. Must not be null.
      shouldReplicate - whether or not the index changes should be replicated to the other nodes in the cluster.
      Throws:
      IndexException
    • reIndexWorklogs

      public long reIndexWorklogs(Collection<Worklog> worklogs) throws IndexException
      Description copied from interface: IssueIndexManager
      Reindexes a collection of worklogs.
      Specified by:
      reIndexWorklogs in interface IssueIndexingService
      Specified by:
      reIndexWorklogs in interface IssueIndexManager
      Parameters:
      worklogs - a collection of Worklogs
      Throws:
      IndexException
    • reIndexWorklogs

      public long reIndexWorklogs(Collection<Worklog> worklogs, Context context) throws IndexException
      Description copied from interface: IssueIndexManager
      Reindexes a collection of worklogs.
      Specified by:
      reIndexWorklogs in interface IssueIndexingService
      Specified by:
      reIndexWorklogs in interface IssueIndexManager
      Parameters:
      worklogs - a collection of Worklogs
      context - used to report progress back to the user or to the logs. Must not be null.
      Throws:
      IndexException
    • reIndexWorklogs

      public long reIndexWorklogs(Collection<Worklog> worklogs, Context context, boolean shouldReplicate) throws IndexException
      Description copied from interface: IssueIndexManager
      Reindexes a collection of worklogs.
      Specified by:
      reIndexWorklogs in interface IssueIndexingService
      Specified by:
      reIndexWorklogs in interface IssueIndexManager
      Parameters:
      worklogs - a collection of Worklogs
      context - used to report progress back to the user or to the logs. Must not be null.
      shouldReplicate - whether or not the index changes should be replicated to the other nodes in the cluster.
      Throws:
      IndexException
    • isIndexConsistent

      public boolean isIndexConsistent()
      Specified by:
      isIndexConsistent in interface IndexLifecycleManager
      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 that false is also returned if the index is not available .
    • getLatestIndexDate

      public Instant getLatestIndexDate()
      Description copied from interface: IssueIndexManager
      Gets the latest index date based on the most recent issue updated date.
      Specified by:
      getLatestIndexDate in interface IssueIndexManager
      Returns:
      latest index update date or null if no issues in index or no updated value in issues
    • size

      public int size()
      Specified by:
      size in interface IndexLifecycleManager
      Specified by:
      size in interface Sized
      Returns:
      how many Entities will be re-indexed by IndexLifecycleManager.reIndexAll(Context)
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Sized
    • optimize

      public long optimize()
      Description copied from interface: IndexLifecycleManager
      Optimize the underlying indexes. Make the subsequent searching more efficient.
      Specified by:
      optimize in interface IndexLifecycleManager
      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.
    • deIndex

      public void deIndex(WithId issueWithId) throws IndexException
      Description copied from interface: IssueIndexingService
      Remove an issue from the search index.
      Specified by:
      deIndex in interface IssueIndexingService
      Throws:
      IndexException
    • deIndexIssueObjectsById

      public void deIndexIssueObjectsById(Set<? extends WithId> issuesToDelete, boolean shouldReplicate)
      Description copied from interface: IssueIndexingService
      Remove a set of issues from the search index.
      Specified by:
      deIndexIssueObjectsById in interface IssueIndexingService
      Parameters:
      issuesToDelete - set of WithIds to deIndex.
      shouldReplicate - whether or not the index changes should be replicated to the other nodes in the cluster.
    • 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
    • conditionalUpdateWithVersion

      public void conditionalUpdateWithVersion(IndexDirectoryFactory.Name indexName, org.apache.lucene.document.Document document)
      Description copied from interface: InternalIndexingService
      Index a Document conditionally based on the entity id and the version which are resolved by IndexDirectoryFactory.Name.getEntityIdFromDocument(Document) and IndexDirectoryFactory.Name.getEntityVersionFromDocument(Document)
      Specified by:
      conditionalUpdateWithVersion in interface InternalIndexingService
      Parameters:
      indexName - define the target index
      document - the document needs to be indexed
    • conditionalUpdateWithVersion

      public void conditionalUpdateWithVersion(org.apache.lucene.document.Document issueDocument, Collection<org.apache.lucene.document.Document> commentDocuments, Collection<org.apache.lucene.document.Document> changeHistoryDocuments, Collection<org.apache.lucene.document.Document> worklogDocuments)
      Description copied from interface: InternalIndexingService
      Index an issue document with its related documents conditionally based on the entity ids and the versions which are resolved by IndexDirectoryFactory.Name.getEntityIdFromDocument(Document) and IndexDirectoryFactory.Name.getEntityVersionFromDocument(Document)
      Specified by:
      conditionalUpdateWithVersion in interface InternalIndexingService
      Parameters:
      issueDocument - issue document needs to be indexed
      commentDocuments - issue's comment documents
      changeHistoryDocuments - issue's history change documents
      worklogDocuments - issue's worklog documents
    • unconditionallyReindexIssuesAndRelatedEntitiesLocally

      public void unconditionallyReindexIssuesAndRelatedEntitiesLocally(Collection<Issue> issueObjects)
      Description copied from interface: InternalIndexingService
      Unconditionally updates issues and all related entities indexes: comments, worklogs and changeHistory. For related entities, the existing collection will be fully replaced by the new collection of related entities. Note that this may leave the index in a stale state when there are any other indexing tasks running in parallel. This operation should be followed by a conditional re-index to fix the possibly stale data. This operation may be needed to delete related entities from index by re-indexing an issue. Note that in a cluster this affects only the local index, i.e. this operation will not be replicated to other nodes. To be removed in Jira 9.0. (DBR-242)
      Specified by:
      unconditionallyReindexIssuesAndRelatedEntitiesLocally in interface InternalIndexingService
      Parameters:
      issueObjects - issues need to be re-indexed unconditionally locally
    • getPluginsRootPath

      public String getPluginsRootPath()
      Description copied from interface: IssueIndexManager
      Get the root path of the index directory for plugins. Any plugin that keeps indexes should create its own sub-directory under this path and create its indexes in its own sub-directory
      Specified by:
      getPluginsRootPath in interface IssueIndexManager
    • getExistingPluginsPaths

      public List<String> getExistingPluginsPaths()
      Description copied from interface: IssueIndexManager
      Returns a collection of Strings, each one representing the absolute path to the actual existing directory where a plugin keeps its indexes. Each directory in the collection should be a sub-directory under the plugin's index root path. See IssueIndexManager.getPluginsRootPath().

      If a plugin index root path does not exist, or is empty (no sub-directopries exist) then an empty collection will be returned.

      Specified by:
      getExistingPluginsPaths in interface IssueIndexManager
    • getIssueSearcher

      public ManagedIndexSearcher getIssueSearcher()
      Description copied from interface: IssueIndexManager
      Get an IndexSearcher that can be used to search the issue index.
      Specified by:
      getIssueSearcher in interface IssueIndexManager
    • getCommentSearcher

      public ManagedIndexSearcher getCommentSearcher()
      Description copied from interface: IssueIndexManager
      Get an IndexSearcher that can be used to search the comment index.
      Specified by:
      getCommentSearcher in interface IssueIndexManager
    • getChangeHistorySearcher

      public ManagedIndexSearcher getChangeHistorySearcher()
      Description copied from interface: IssueIndexManager
      Get an IndexSearcher that can be used to search the change history index.
      Specified by:
      getChangeHistorySearcher in interface IssueIndexManager
    • getWorklogSearcher

      public ManagedIndexSearcher getWorklogSearcher()
      Description copied from interface: IssueIndexManager
      Get an IndexSearcher that can be used to search the worklog index.
      Specified by:
      getWorklogSearcher in interface IssueIndexManager
    • getEntitySearcher

      public ManagedIndexSearcher getEntitySearcher(IndexDirectoryFactory.Name index)
      Description copied from interface: InternalIndexingService
      Get an IndexSearcher that can be used to search the index specified by the IndexDirectoryFactory.Name.
      Specified by:
      getEntitySearcher in interface InternalIndexingService
      Parameters:
      index - Index for which a searcher should be returned
    • reindexIssuesBatchMode

      public void reindexIssuesBatchMode(Collection<Long> issuesIdsToReindex, Context context, IssueIndexingParams params) throws IndexException
      Description copied from interface: InternalIndexingService
      Reindexes issues with ids provided with issuesIdsToReindex. Like foreground reindex will perform the reindex operations under index write lock and on multiple threads. The lock is needed because of 2 reasons: - the updates are not conditional (so we could overwrite newer concurrent update) - multithreading could saturate the indexer.
      Specified by:
      reindexIssuesBatchMode in interface InternalIndexingService
      Parameters:
      issuesIdsToReindex - ids specifying which issues to reindex.
      context - used to report progress back to the user or to the logs.
      params - determines witch related objects should be indexed together with issues.
      Throws:
      IndexException - in case the lock couldn't be acquired.
    • reindexCommentsInParallel

      public void reindexCommentsInParallel(Collection<Comment> comments, Context context) throws IndexException
      Description copied from interface: InternalIndexingService
      Reindexes comments on multiple threads. Performs the operation under index write lock The lock is needed because of 2 reasons: - the updates are not conditional (so we could overwrite newer concurrent update) - multithreading could saturate the indexer.
      Specified by:
      reindexCommentsInParallel in interface InternalIndexingService
      Parameters:
      comments - comments to reindex
      context - used to report progress back to the user or to the logs.
      Throws:
      IndexException - in case the lock couldn't be acquired.
    • reindexWorklogsInParallel

      public void reindexWorklogsInParallel(Collection<Worklog> worklogs, Context context) throws IndexException
      Description copied from interface: InternalIndexingService
      Reindexes worklogs on multiple threads. Performs the operation under index write lock The lock is needed because of 2 reasons: - the updates are not conditional (so we could overwrite newer concurrent update) - multithreading could saturate the indexer.
      Specified by:
      reindexWorklogsInParallel in interface InternalIndexingService
      Parameters:
      worklogs - worklogs to reindex
      context - used to report progress back to the user or to the logs.
      Throws:
      IndexException - in case the lock couldn't be acquired.
    • getAllIndexPaths

      public Collection<String> getAllIndexPaths()
      Specified by:
      getAllIndexPaths in interface IndexLifecycleManager
      Returns:
      a collection of Strings that map to all paths that contain Lucene indexes. Must not be null.
    • shutdown

      public void shutdown()
      Description copied from interface: IndexLifecycleManager
      Shuts down the indexing manager and closes its resources (if any).
      Specified by:
      shutdown in interface IndexLifecycleManager
      Specified by:
      shutdown in interface Shutdown
    • toString

      public String toString()
      Overrides:
      toString in class Object