Class IndexManagerBase

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

@Deprecated(since="10.4", forRemoval=true) public class IndexManagerBase extends Object implements JiraIndexManager
Deprecated, for removal: This API element is subject to removal in a future version.
since 10.4 for removal. No replacement.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.apache.lucene.analysis.Analyzer
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static final org.apache.lucene.analysis.Analyzer
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    IndexManagerBase(IndexingConfiguration indexProperties, IssueIndexer issueIndexer, IndexPathManager indexPath, ReindexMessageManager reindexMessageManager, com.atlassian.event.api.EventPublisher eventPublisher, ListenerManager listenerManager, ProjectManager projectManager, IssueManager issueManager, TaskManager taskManager, OfBizDelegator ofBizDelegator, ArchivingDao archivingDao, SearcherCache searcherCache, TimeTrackingConfiguration timeTrackingConfiguration, IndexingLanguageSetting indexingLanguageSetting, ReindexingAuditHandler reindexingAuditHandler, ArchivingLicenseCheck archivingLicenseCheck, FeatureManager featureManager, IndexConsistencyChecker indexConsistencyChecker)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    activate(Context context)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Activates search indexes.
    long
    activate(Context context, boolean reindex)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Activates search indexes.
    void
    conditionalUpdateWithVersion(IndexDirectoryFactory.Name indexName, org.apache.lucene.document.Document document)
    Deprecated, for removal: This API element is subject to removal in a future version.
    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)
    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)
    Deprecated, for removal: This API element is subject to removal in a future version.
    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)
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    De-activates indexing (as happens from the admin page) and removes index directories.
    void
    deIndex(WithId issueWithId)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Remove an issue from the search index.
    void
    deIndex(Project project, boolean shouldReplicate)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Deindexing issues from a given project
    void
    deIndex(org.ofbiz.core.entity.GenericValue entity)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Remove an issue from the search index.
    void
    deIndexComments(Set<WithId> commentsToDeIndex, boolean shouldReplicate)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Remove a set of comments from the search index.
    void
    deIndexIssueObjectsById(Set<? extends WithId> issuesToDelete, boolean shouldReplicate)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Remove a set of issues from the search index.
    void
    deIndexWorklogs(Set<WithId> worklogsToDeIndex, boolean shouldReplicate)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Remove a set of worklogs from the search index.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    org.apache.lucene.analysis.Analyzer
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns an Analyzer for indexing.
    org.apache.lucene.analysis.Analyzer
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns an Analyzer for searching.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get an IndexSearcher that can be used to search the change history index.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get an IndexSearcher that can be used to search the comment index.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get an IndexSearcher that can be used to search the index specified by the IndexDirectoryFactory.Name.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns a collection of Strings, each one representing the absolute path to the actual existing directory where a plugin keeps its indexes.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get an IndexSearcher that can be used to search the issue index.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the latest index date based on the most recent issue updated date.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the root path of the index directory for plugins.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get an IndexSearcher that can be used to search the worklog index.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Temporarily suspend indexing on this thread.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return true if the index is held on this thread.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Whether this index is available.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    long
    Deprecated, for removal: This API element is subject to removal in a future version.
    Optimize the underlying indexes.
    void
    reIndex(Issue issue)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex an issue (eg.
    void
    reIndex(Issue issue, boolean reIndexComments, boolean reIndexChangeHistory)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex an issue (eg.
    void
    reIndex(Issue issue, IssueIndexingParams issueIndexingParams)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex an issue (eg.
    void
    reIndex(org.ofbiz.core.entity.GenericValue issueGV)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex an issue (eg.
    long
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex all issues.
    long
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex everything.
    long
    reIndexAll(Context context, boolean useBackgroundIndexing)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    long
    reIndexAll(Context context, boolean useBackgroundIndexing, boolean notifyCluster)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex all issues.
    long
    reIndexAll(Context context, boolean useBackgroundIndexing, boolean reIndexComments, boolean reIndexChangeHistory, boolean notifyCluster)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex all issues.
    long
    reIndexAll(Context context, boolean useBackgroundIndexing, IssueIndexingParams issueIndexingParams, boolean notifyCluster)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex all issues.
    long
    reIndexAll(Context context, IssueIndexingParams issueIndexingParams)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex indexes defined by the IssueIndexingParams.
    long
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex everything, but don't stop the world Comments and change history will not be reindexed.
    long
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindexes a collection of comments.
    long
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindexes a collection of comments.
    long
    reIndexComments(Collection<Comment> comments, Context context, boolean shouldReplicate)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindexes a collection of comments.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindexes comments on multiple threads.
    long
    reIndexIssueObjects(Collection<? extends Issue> issueObjects)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex a set of issues.
    long
    reIndexIssueObjects(Collection<? extends Issue> issueObjects, boolean reIndexComments, boolean reIndexChangeHistory)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex a set of issues.
    long
    reIndexIssueObjects(Collection<? extends Issue> issueObjects, boolean reIndexComments, boolean reIndexChangeHistory, boolean shouldReplicate)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex a set of issues.
    long
    reIndexIssueObjects(Collection<? extends Issue> issueObjects, IssueIndexingParams issueIndexingParams)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex a set of issues.
    long
    reIndexIssueObjects(Collection<? extends Issue> issueObjects, IssueIndexingParams issueIndexingParams, boolean shouldReplicate)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex a set of issues.
    long
    reIndexIssues(IssuesIterable issuesIterable, Context context)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex a list of issues, passing an optional event that will be set progress
    long
    reIndexIssues(IssuesIterable issuesIterable, Context context, boolean reIndexComments, boolean reIndexChangeHistory)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex a list of issues, passing an optional event that will be set progress.
    long
    reIndexIssues(IssuesIterable issuesIterable, Context context, IssueIndexingParams issueIndexingParams)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex a list of issues, passing an optional event that will be set progress.
    long
    reIndexIssues(IssuesIterable issuesIterable, Context context, IssueIndexingParams issueIndexingParams, boolean shouldReplicate)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex a list of issues, passing an optional Context for providing status updates.
    long
    reIndexIssues(Collection<org.ofbiz.core.entity.GenericValue> issues)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex a set of issues (GenericValues).
    protected long
    reIndexIssues(Collection<org.ofbiz.core.entity.GenericValue> issues, IssueIndexingParams issueIndexingParams)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    reindexIssuesBatchMode(Collection<Long> issuesIdsToReindex, Context context, IssueIndexingParams params)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindexes issues with ids provided with issuesIdsToReindex.
    long
    reIndexIssuesInBackground(Context context, IssueIndexingParams issueIndexingParams)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindex everything, but don't stop the world
    long
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindexes a collection of worklogs.
    long
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindexes a collection of worklogs.
    long
    reIndexWorklogs(Collection<Worklog> worklogs, Context context, boolean shouldReplicate)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindexes a collection of worklogs.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reindexes worklogs on multiple threads.
    long
    Deprecated, for removal: This API element is subject to removal in a future version.
    Release indexing on this thread.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Shuts down the indexing manager and closes its resources (if any).
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Unconditionally updates issues and all related entities indexes: comments, worklogs and changeHistory.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    This method takes a runnable that is run under the 'stop the world' reindex lock.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.atlassian.jira.issue.index.IssueIndexingService

    deIndex, deIndexIssueObjects
  • Field Details

    • ANALYZER_FOR_SEARCHING

      public static final org.apache.lucene.analysis.Analyzer ANALYZER_FOR_SEARCHING
      Deprecated, for removal: This API element is subject to removal in a future version.
    • ANALYZER_FOR_INDEXING

      public static final org.apache.lucene.analysis.Analyzer ANALYZER_FOR_INDEXING
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

  • Method Details

    • getAnalyzerForSearching

      public org.apache.lucene.analysis.Analyzer getAnalyzerForSearching()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • reIndexAll

      public long reIndexAll(Context context, boolean useBackgroundIndexing, boolean notifyCluster)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IndexException
    • reIndexIssueObjects

      public long reIndexIssueObjects(Collection<? extends Issue> issueObjects) throws IndexException
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IssueIndexManager
      Reindex an issue (eg. after field updates).
      Specified by:
      reIndex in interface IssueIndexManager
      Throws:
      IndexException
    • hold

      public void hold()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 IssueIndexingService
      Specified by:
      hold in interface IssueIndexManager
    • isHeld

      public boolean isHeld()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IssueIndexManager
      Return true if the index is held on this thread.
      Specified by:
      isHeld in interface IssueIndexingService
      Specified by:
      isHeld in interface IssueIndexManager
    • release

      public long release() throws IndexException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IssueIndexManager
      Release indexing on this thread. All queued index requests will be processed.
      Specified by:
      release in interface IssueIndexingService
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      isEmpty in interface Sized
    • optimize

      public long optimize()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class Object