Interface InternalIndexingService

All Known Implementing Classes:
BulkOnlyIndexManager, DefaultIndexManager

public interface InternalIndexingService
  • Method Details

    • conditionalUpdateWithVersion

      void conditionalUpdateWithVersion(IndexDirectoryFactory.Name indexName, org.apache.lucene.document.Document document)
      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)
      Parameters:
      indexName - define the target index
      document - the document needs to be indexed
    • conditionalUpdateWithVersion

      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)
      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)
      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

      @Internal void unconditionallyReindexIssuesAndRelatedEntitiesLocally(Collection<Issue> issueObjects)
      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)
      Parameters:
      issueObjects - issues need to be re-indexed unconditionally locally
    • getEntitySearcher

      Get an IndexSearcher that can be used to search the index specified by the IndexDirectoryFactory.Name.
      Parameters:
      index - Index for which a searcher should be returned
    • reindexIssuesBatchMode

      void reindexIssuesBatchMode(Collection<Long> issuesIdsToReindex, Context context, IssueIndexingParams params) throws IndexException
      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.
      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

      void reindexCommentsInParallel(Collection<Comment> comments, Context context) throws IndexException
      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.
      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

      void reindexWorklogsInParallel(Collection<Worklog> worklogs, Context context) throws IndexException
      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.
      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.