Class OpenSearchJiraIndexManager

java.lang.Object
com.atlassian.jira.search.opensearch.OpenSearchIssueIndexManager
com.atlassian.jira.search.opensearch.OpenSearchJiraIndexManager
All Implemented Interfaces:
InternalIndexingService, IssueIndexingService, IssueIndexManager, JiraIndexManager, IndexSearcherProvider, Sized, IndexLifecycleManager, Shutdown

@Internal @Deprecated public class OpenSearchJiraIndexManager extends OpenSearchIssueIndexManager implements JiraIndexManager
Deprecated.
since 11.0
OpenSearchJiraIndexManager is a temporary workaround until all usages of the deprecated interfaces JiraIndexManager, IssueIndexManager and InternalIndexingService are replaced with Search API alternatives such as IndexLifecycleManager and IssueIndexingService. It is registered with Spring when the Search Platform is OpenSearch to prevent dependency resolution errors on startup where the deprecated interfaces are still used. When Lucene is the search platform, the OpenSearchJiraIndexManager is not registered and the deprecated interfaces are provided by DefaultIndexManager.
  • Constructor Details

  • Method Details

    • conditionalUpdateWithVersion

      public void conditionalUpdateWithVersion(IndexDirectoryFactory.Name indexName, org.apache.lucene.document.Document document)
      Deprecated.
      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.
      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.
      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
    • getEntitySearcher

      public ManagedIndexSearcher getEntitySearcher(IndexDirectoryFactory.Name index)
      Deprecated.
      Description copied from interface: InternalIndexingService
      Get an IndexSearcher that can be used to search the index specified by the IndexDirectoryFactory.Name. This is specific to Lucene search platform, use IndexAccessorRegistry to get a platform-agnostic IndexSearcher instead.
      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.
      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.
      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.
      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.
    • getPluginsRootPath

      public String getPluginsRootPath()
      Deprecated.
      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 Collection<String> getExistingPluginsPaths()
      Deprecated.
      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.
      Description copied from interface: IssueIndexManager
      Get an IndexSearcher that can be used to search the issue index. This is specific to Lucene search platform, use IndexAccessorRegistry to get a platform-agnostic IndexSearcher instead.
      Specified by:
      getIssueSearcher in interface IssueIndexManager
    • getCommentSearcher

      public ManagedIndexSearcher getCommentSearcher()
      Deprecated.
      Description copied from interface: IssueIndexManager
      Get an IndexSearcher that can be used to search the comment index. This is specific to Lucene search platform, use IndexAccessorRegistry to get a platform-agnostic IndexSearcher instead.
      Specified by:
      getCommentSearcher in interface IssueIndexManager
    • getChangeHistorySearcher

      public ManagedIndexSearcher getChangeHistorySearcher()
      Deprecated.
      Description copied from interface: IssueIndexManager
      Get an IndexSearcher that can be used to search the change history index. This is specific to Lucene search platform, use IndexAccessorRegistry to get a platform-agnostic IndexSearcher instead.
      Specified by:
      getChangeHistorySearcher in interface IssueIndexManager
    • getWorklogSearcher

      public ManagedIndexSearcher getWorklogSearcher()
      Deprecated.
      Description copied from interface: IssueIndexManager
      Get an IndexSearcher that can be used to search the worklog index. This is specific to Lucene search platform, use IndexAccessorRegistry to get a platform-agnostic IndexSearcher instead.
      Specified by:
      getWorklogSearcher in interface IssueIndexManager
    • getAnalyzerForSearching

      public org.apache.lucene.analysis.Analyzer getAnalyzerForSearching()
      Deprecated.
      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.
      Description copied from interface: IssueIndexManager
      Returns an Analyzer for indexing.
      Specified by:
      getAnalyzerForIndexing in interface IssueIndexManager
      Returns:
      an analyzer for indexing.
    • reIndexAll

      public long reIndexAll(Context context, boolean useBackgroundReindexing, boolean reIndexComments, boolean reIndexChangeHistory, boolean notifyCluster) throws IndexException
      Deprecated.
      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
      useBackgroundReindexing - 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.
      Throws:
      IndexException
    • reIndex

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

      public long reIndexIssues(IssuesIterable issuesIterable, Context context, boolean reIndexComments, boolean reIndexChangeHistory) throws IndexException
      Deprecated.
      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
    • reIndex

      public void reIndex(Issue issue, boolean reIndexComments, boolean reIndexChangeHistory) throws IndexException
      Deprecated.
      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 issue) throws IndexException
      Deprecated.
      Description copied from interface: IssueIndexManager
      Remove an issue from the search index.
      Specified by:
      deIndex in interface IssueIndexManager
      Throws:
      IndexException
    • reIndexIssues

      public long reIndexIssues(Collection<org.ofbiz.core.entity.GenericValue> issues) throws IndexException
      Deprecated.
      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<? extends Issue> issueObjects, boolean reIndexComments, boolean reIndexChangeHistory) throws IndexException
      Deprecated.
      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, boolean reIndexComments, boolean reIndexChangeHistory, boolean shouldReplicate) throws IndexException
      Deprecated.
      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.
      Throws:
      IndexException
    • withReindexLock

      public boolean withReindexLock(Runnable runnable)
      Deprecated.
      There is no reindex lock for OpenSearch since it re-indexes in a blue/green fashion remaining online throughout the reindex.
      Specified by:
      withReindexLock in interface IssueIndexManager
      Parameters:
      runnable - the runnable to execute
      Returns:
      true if the lock could be acquired, false otherwise
      Throws:
      UnsupportedOperationException - operation is not supported on Lucene