Package com.atlassian.jira.issue.index
Interface IssueIndexer
- All Superinterfaces:
BackupContributor
,UnmanagedIndexSearcherProvider
- All Known Implementing Classes:
DefaultIssueIndexer
,MockIssueIndexer
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionconditionalUpdateWithVersion
(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)
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)
deindexComments
(Collection<? extends WithId> comments, Context context, boolean shouldReplicate) deindexIssues
(Collection<? extends WithId> issues, Context context) Delete any existing documents (in the issue index & all related entity indexes) for the Issues represented by the supplied WithIdsdeindexIssues
(Collection<? extends WithId> issues, Context context, boolean shouldReplicate) Delete any existing documents (in the issue index & all related entity indexes) for the Issues represented by the supplied WithIdsdeIndexProject
(Project project, boolean shouldReplicate) Remove all documents connected with given projectdeindexWorklogs
(Collection<? extends WithId> worklogs, Context context, boolean shouldReplicate) void
Delete all indexes.void
deleteIndexes
(IssueIndexingParams issueIndexingParams) Delete selected indexes.indexIssues
(EnclosedIterable<Issue> issues, Context context, IssueIndexingParams issueIndexingParams) Add documents for the supplied issues.indexIssuesBatchMode
(IssuesBatcher batcher, Context context, IssueIndexingParams issueIndexingParams) Index all issues from the given batcher.optimize()
reindexComments
(Collection<Comment> comments, Context context, boolean shouldReplicate) Reindex a collection of issue comments.reindexCommentsInParallel
(Collection<Comment> comments, Context context) Reindex a collection of issue comments on multiple threads.reindexIssues
(EnclosedIterable<Issue> issues, Context context, IssueIndexingParams issueIndexingParams, boolean conditionalUpdate, boolean shouldReplicate) Re-index the given issues, delete any existing documents and add new ones.reindexIssuesBatchMode
(IssuesBatcher issuesBatcher, Context context, IssueIndexingParams issueIndexingParams) Reindex issues from the given collection.reindexWorklogs
(Collection<Worklog> worklogs, Context context, boolean shouldReplicate) reindexWorklogsInParallel
(Collection<Worklog> worklogs, Context context) Reindex a collection of issue worklogs on multiple threads.void
shutdown()
Methods inherited from interface com.atlassian.jira.index.ha.backup.BackupContributor
contributeToBackup
Methods inherited from interface com.atlassian.jira.issue.index.UnmanagedIndexSearcherProvider
openEntitySearcher
-
Method Details
-
indexIssues
Index.Result indexIssues(@Nonnull EnclosedIterable<Issue> issues, @Nonnull Context context, @Nonnull IssueIndexingParams issueIndexingParams) Add documents for the supplied issues.- Parameters:
issues
- An iterable of issues to index.context
- for showing the user the current status.issueIndexingParams
- parameters describing what should be reindexed- Since:
- 6.4
-
deindexIssues
Delete any existing documents (in the issue index & all related entity indexes) for the Issues represented by the supplied WithIds- Parameters:
issues
- An iterable of WithIds for the Issues to de-index.context
- for showing the user the current status.
-
deindexIssues
Index.Result deindexIssues(@Nonnull Collection<? extends WithId> issues, @Nonnull Context context, boolean shouldReplicate) Delete any existing documents (in the issue index & all related entity indexes) for the Issues represented by the supplied WithIds- Parameters:
issues
- An iterable of WithIds for the Issues to de-index.context
- for showing the user the current status.shouldReplicate
- whether or not the index changes should be replicated to the other nodes in the cluster.
-
reindexIssuesBatchMode
AccumulatingResultBuilder reindexIssuesBatchMode(@Nonnull IssuesBatcher issuesBatcher, @Nonnull Context context, @Nonnull IssueIndexingParams issueIndexingParams) Reindex issues from the given collection. As this method is not using conditional updates it must be executed under index write lock. It reindexes issues in multiple threads using the same parallelism mechanism as { @link IssueIndexer#indexIssuesBatchMode}- Parameters:
issuesBatcher
- an iterable over issue batches.context
- for showing the user the current status.issueIndexingParams
- parameters describing what should be reindexed- Since:
- 9.3
-
reindexIssues
Index.Result reindexIssues(@Nonnull EnclosedIterable<Issue> issues, @Nonnull Context context, @Nonnull IssueIndexingParams issueIndexingParams, boolean conditionalUpdate, boolean shouldReplicate) Re-index the given issues, delete any existing documents and add new ones.- Parameters:
issues
- An iterable of issues to index.context
- for showing the user the current status.issueIndexingParams
- parameters describing what should be reindexedconditionalUpdate
- set to true to use conditional updates when writing to the indexshouldReplicate
- whether or not the index changes should be replicated to the other nodes in the cluster.- Since:
- 6.4
-
reindexComments
Index.Result reindexComments(@Nonnull Collection<Comment> comments, @Nonnull Context context, boolean shouldReplicate) Reindex a collection of issue comments.- Parameters:
comments
- Comments to be reindexed.context
- for showing the user the current status.shouldReplicate
- whether or not the index changes should be replicated to the other nodes in the cluster.
-
reindexCommentsInParallel
Index.Result reindexCommentsInParallel(@Nonnull Collection<Comment> comments, @Nonnull Context context) Reindex a collection of issue comments on multiple threads. This will not replicate the comments to the other nodes in cluster. As this method does not use conditional updates, it must be executed under index write lock.- Parameters:
comments
- Comments to be reindexed.context
- for showing the user the current status.
-
reindexWorklogsInParallel
Index.Result reindexWorklogsInParallel(@Nonnull Collection<Worklog> worklogs, @Nonnull Context context) Reindex a collection of issue worklogs on multiple threads. This will not replicate the worklogs to the other nodes in cluster. As this method does not use conditional updates, it must be executed under index write lock.- Parameters:
worklogs
- Worklogs to be reindexed.context
- for showing the user the current status.
-
reindexWorklogs
Index.Result reindexWorklogs(@Nonnull Collection<Worklog> worklogs, @Nonnull Context context, boolean shouldReplicate) -
deindexComments
Index.Result deindexComments(@Nonnull Collection<? extends WithId> comments, @Nonnull Context context, boolean shouldReplicate) -
deindexWorklogs
Index.Result deindexWorklogs(@Nonnull Collection<? extends WithId> worklogs, @Nonnull Context context, boolean shouldReplicate) -
conditionalUpdateWithVersion
Index.Result 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
Index.Result 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
-
indexIssuesBatchMode
AccumulatingResultBuilder indexIssuesBatchMode(@Nonnull IssuesBatcher batcher, @Nonnull Context context, @Nonnull IssueIndexingParams issueIndexingParams) Index all issues from the given batcher.- Parameters:
batcher
- An iterable over issue batches.context
- for showing the user the current status.issueIndexingParams
- parameters describing what should be reindexed- Since:
- 8.0
-
optimize
Index.Result optimize() -
deleteIndexes
void deleteIndexes()Delete all indexes. -
deleteIndexes
Delete selected indexes.- Parameters:
issueIndexingParams
- parameters describing which indexes should be deleted.
-
deIndexProject
Remove all documents connected with given project- Parameters:
project
- project objectshouldReplicate
-
-
shutdown
void shutdown() -
getIndexPaths
-
getIndexRootPath
String getIndexRootPath()
-