Package com.atlassian.jira.issue.index
Interface InternalIndexingService
- All Known Implementing Classes:
BulkOnlyIndexManager
,DefaultIndexManager
public interface InternalIndexingService
-
Method Summary
Modifier and TypeMethodDescriptionvoid
conditionalUpdateWithVersion
(IndexDirectoryFactory.Name indexName, org.apache.lucene.document.Document document) Index aDocument
conditionally based on the entity id and the version which are resolved byIndexDirectoryFactory.Name.getEntityIdFromDocument(Document)
andIndexDirectoryFactory.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) Index an issue document with its related documents conditionally based on the entity ids and the versions which are resolved byIndexDirectoryFactory.Name.getEntityIdFromDocument(Document)
andIndexDirectoryFactory.Name.getEntityVersionFromDocument(Document)
Get anIndexSearcher
that can be used to search the index specified by theIndexDirectoryFactory.Name
.void
reindexCommentsInParallel
(Collection<Comment> comments, Context context) Reindexes comments on multiple threads.void
reindexIssuesBatchMode
(Collection<Long> issuesIdsToReindex, Context context, IssueIndexingParams params) Reindexes issues with ids provided withissuesIdsToReindex
.void
reindexWorklogsInParallel
(Collection<Worklog> worklogs, Context context) Reindexes worklogs on multiple threads.void
unconditionallyReindexIssuesAndRelatedEntitiesLocally
(Collection<Issue> issueObjects) Unconditionally updates issues and all related entities indexes: comments, worklogs and changeHistory.
-
Method Details
-
conditionalUpdateWithVersion
void conditionalUpdateWithVersion(IndexDirectoryFactory.Name indexName, org.apache.lucene.document.Document document) Index aDocument
conditionally based on the entity id and the version which are resolved byIndexDirectoryFactory.Name.getEntityIdFromDocument(Document)
andIndexDirectoryFactory.Name.getEntityVersionFromDocument(Document)
- Parameters:
indexName
- define the target indexdocument
- 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 byIndexDirectoryFactory.Name.getEntityIdFromDocument(Document)
andIndexDirectoryFactory.Name.getEntityVersionFromDocument(Document)
- Parameters:
issueDocument
- issue document needs to be indexedcommentDocuments
- issue's comment documentschangeHistoryDocuments
- issue's history change documentsworklogDocuments
- 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 anIndexSearcher
that can be used to search the index specified by theIndexDirectoryFactory.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 withissuesIdsToReindex
. 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
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 reindexcontext
- used to report progress back to the user or to the logs.- Throws:
IndexException
- in case the lock couldn't be acquired.
-
reindexWorklogsInParallel
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 reindexcontext
- used to report progress back to the user or to the logs.- Throws:
IndexException
- in case the lock couldn't be acquired.
-