Class DefaultBulkIssueIndexer
java.lang.Object
com.atlassian.jira.search.index.bulk.DefaultBulkIssueIndexer
- All Implemented Interfaces:
BulkIssueIndexer
Responsible for handling bulk reindexing managing the producer and consumer threads.
Each request to run a reindex, should create a new
Each request to run a reindex, should create a new
DefaultBulkIssueIndexer via
DefaultBulkIssueIndexerFactory.createBulkIssueIndexer(IndexWriter)-
Constructor Summary
ConstructorsConstructorDescriptionDefaultBulkIssueIndexer(IndexWriter indexWriter, IndexingFeatures indexingFeatures, BatchIssuesReindexQueueConsumerFactory batchIssuesReindexQueueConsumerFactory, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionvoidWhen cancelled, shutdown the executor threadpools and return back the result.reindexAllIssues(IssuesBatcher batcher, Context context) This is the main entry point for a full reindex.
-
Constructor Details
-
DefaultBulkIssueIndexer
public DefaultBulkIssueIndexer(IndexWriter indexWriter, IndexingFeatures indexingFeatures, BatchIssuesReindexQueueConsumerFactory batchIssuesReindexQueueConsumerFactory, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
reindexAllIssues
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:
reindexAllIssuesin interfaceBulkIssueIndexer- Parameters:
batcher- the batcher to provide the issues for indexingcontext- the context for the reindexing operation- Returns:
- the result of the reindexing operation
-
onReindexCancelledEvent
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
-