Class DefaultBulkIssueIndexer

java.lang.Object
com.atlassian.jira.search.index.bulk.DefaultBulkIssueIndexer
All Implemented Interfaces:
BulkIssueIndexer

public class DefaultBulkIssueIndexer extends Object implements BulkIssueIndexer
Responsible for handling bulk reindexing managing the producer and consumer threads.
Each request to run a reindex, should create a new DefaultBulkIssueIndexer via DefaultBulkIssueIndexerFactory.createBulkIssueIndexer(IndexWriter)
  • Constructor Details

  • Method Details

    • reindexAllIssues

      public BulkIndexResult reindexAllIssues(@Nonnull IssuesBatcher batcher, @Nonnull Context context)
      This is the main entry point for a full reindex. - Producer gets batches of issues from the DB and places them on the processingQueue - MultiThreadedIssuesReindexQueueConsumer starts multiple threads each with a consumer - Each consumer reads issues from the processingQueue, creates a batch of Documents and passes them to the Index Writer - IndexWriter creates a Bulk Index request and sends to the index
      Specified by:
      reindexAllIssues in interface BulkIssueIndexer
      Parameters:
      batcher - the batcher to provide the issues for indexing
      context - the context for the reindexing operation
      Returns:
      the result of the reindexing operation
    • onReindexCancelledEvent

      @EventListener public void onReindexCancelledEvent(ReindexCancelledByUserEvent event)
      When cancelled, shutdown the executor threadpools and return back the result. The cancellation status will be used to determine the successful cancellation on the UI. Note that although the class and the method reindexAllIssues is not thread safe, it is ok for this to be called to cancel and shutdown the executors by another thread.
      Parameters:
      event - the cancellation event