public class DefaultIssueIndexer extends Object implements IssueIndexer
Modifier and Type | Class and Description |
---|---|
static interface |
DefaultIssueIndexer.ChangeHistoryRetriever |
static interface |
DefaultIssueIndexer.CommentRetriever |
class |
DefaultIssueIndexer.Documents |
static interface |
DefaultIssueIndexer.EntityRetriever<T extends WithId> |
static interface |
DefaultIssueIndexer.WorklogRetriever |
IssueIndexer.Analyzers
Constructor and Description |
---|
DefaultIssueIndexer(IndexDirectoryFactory indexDirectoryFactory,
DefaultIssueIndexer.CommentRetriever commentRetriever,
DefaultIssueIndexer.ChangeHistoryRetriever changeHistoryRetriever,
DefaultIssueIndexer.WorklogRetriever worklogRetriever,
ApplicationProperties applicationProperties,
IssueDocumentFactory issueDocumentFactory,
CommentDocumentFactory commentDocumentFactory,
ChangeHistoryDocumentFactory changeHistoryDocumentFactory,
WorklogDocumentFactory worklogDocumentFactory,
IssueManager issueManager,
IndexPathManager indexPathManager,
IndexBackupContributionStrategy backupPreparationStrategy,
IndexBackupContributorsManager indexBackupContributorsManager,
DBRSender dbrSender,
EntityVersioningManager entityVersioningManager,
ReplicatedIndexManager replicatedIndexManager,
IndexingFeatures indexingFeatures) |
Modifier and Type | Method and Description |
---|---|
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 by
IndexDirectoryFactory.Name.getEntityIdFromDocument(Document) and
IndexDirectoryFactory.Name.getEntityVersionFromDocument(Document) |
Index.Result |
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) |
void |
contributeToBackup(BackupBuilder backupBuilder)
Contribute a set of files to the given
backupBuilder to include them in the backup being created when this method was called. |
Index.Result |
deindexComments(Collection<? extends WithId> comments,
Context context,
boolean shouldReplicate) |
Index.Result |
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 WithIds
|
Index.Result |
deindexIssues(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 WithIds
|
Index.Result |
deIndexProject(Project project,
boolean shouldReplicate)
Remove all documents connected with given project
|
Index.Result |
deindexWorklogs(Collection<? extends WithId> worklogs,
Context context,
boolean shouldReplicate) |
void |
deleteIndexes()
Delete all indexes.
|
void |
deleteIndexes(IssueIndexingParams issueIndexingParams)
Delete selected indexes.
|
List<String> |
getIndexPaths() |
String |
getIndexRootPath() |
int |
getNumberOfIndexingThreads() |
Index.Result |
indexIssues(EnclosedIterable<Issue> issues,
Context context)
Add documents for the supplied issues.
|
Index.Result |
indexIssues(EnclosedIterable<Issue> issues,
Context context,
IssueIndexingParams issueIndexingParams)
Add documents for the supplied issues.
|
AccumulatingResultBuilder |
indexIssuesBatchMode(IssuesBatcher batcher,
Context context,
IssueIndexingParams issueIndexingParams)
No other index operations should be called while this method is being called
|
UnmanagedIndexSearcher |
openEntitySearcher(IndexDirectoryFactory.Name index)
Issue searcher has to be closed after doing stuff.
|
Index.Result |
optimize() |
Index.Result |
reindexComments(Collection<Comment> comments,
Context context,
boolean shouldReplicate)
Reindex a collection of issue comments.
|
Index.Result |
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.
|
Index.Result |
reindexWorklogs(Collection<Worklog> worklogs,
Context context,
boolean shouldReplicate) |
void |
shutdown() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
deindexIssues
public DefaultIssueIndexer(@Nonnull IndexDirectoryFactory indexDirectoryFactory, @Nonnull DefaultIssueIndexer.CommentRetriever commentRetriever, @Nonnull DefaultIssueIndexer.ChangeHistoryRetriever changeHistoryRetriever, @Nonnull DefaultIssueIndexer.WorklogRetriever worklogRetriever, @Nonnull ApplicationProperties applicationProperties, @Nonnull IssueDocumentFactory issueDocumentFactory, @Nonnull CommentDocumentFactory commentDocumentFactory, @Nonnull ChangeHistoryDocumentFactory changeHistoryDocumentFactory, @Nonnull WorklogDocumentFactory worklogDocumentFactory, @Nonnull IssueManager issueManager, @Nonnull IndexPathManager indexPathManager, @Nonnull IndexBackupContributionStrategy backupPreparationStrategy, @Nullable IndexBackupContributorsManager indexBackupContributorsManager, @Nonnull DBRSender dbrSender, @Nonnull EntityVersioningManager entityVersioningManager, @Nonnull ReplicatedIndexManager replicatedIndexManager, @Nonnull IndexingFeatures indexingFeatures)
public int getNumberOfIndexingThreads()
@GuardedBy(value="external index read lock") public Index.Result deindexIssues(@Nonnull Collection<? extends WithId> issues, @Nonnull Context context)
IssueIndexer
deindexIssues
in interface IssueIndexer
issues
- An iterable of WithIds for the Issues to de-index.context
- for showing the user the current status.@GuardedBy(value="external index read lock") public Index.Result deindexIssues(@Nonnull Collection<? extends WithId> issues, @Nonnull Context context, boolean shouldReplicate)
IssueIndexer
deindexIssues
in interface IssueIndexer
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.public Index.Result deIndexProject(Project project, boolean shouldReplicate)
IssueIndexer
deIndexProject
in interface IssueIndexer
project
- project object@GuardedBy(value="external index read lock") public Index.Result indexIssues(@Nonnull EnclosedIterable<Issue> issues, @Nonnull Context context)
IssueIndexer
indexIssues
in interface IssueIndexer
issues
- An iterable of issues to index.context
- for showing the user the current status.@GuardedBy(value="external index read lock") public Index.Result indexIssues(@Nonnull EnclosedIterable<Issue> issues, @Nonnull Context context, @Nonnull IssueIndexingParams issueIndexingParams)
IssueIndexer
indexIssues
in interface IssueIndexer
issues
- An iterable of issues to index.context
- for showing the user the current status.issueIndexingParams
- parameters describing what should be reindexed@GuardedBy(value="external index write lock") public AccumulatingResultBuilder indexIssuesBatchMode(@Nonnull IssuesBatcher batcher, @Nonnull Context context, @Nonnull IssueIndexingParams issueIndexingParams)
indexIssuesBatchMode
in interface IssueIndexer
batcher
- An iterable over issue batches.context
- for showing the user the current status.issueIndexingParams
- parameters describing what should be reindexed@GuardedBy(value="external index read lock") public Index.Result reindexIssues(@Nonnull EnclosedIterable<Issue> issues, @Nonnull Context context, @Nonnull IssueIndexingParams issueIndexingParams, boolean conditionalUpdate, boolean shouldReplicate)
IssueIndexer
reindexIssues
in interface IssueIndexer
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.@GuardedBy(value="external index read lock") public Index.Result reindexComments(@Nonnull Collection<Comment> comments, @Nonnull Context context, boolean shouldReplicate)
IssueIndexer
reindexComments
in interface IssueIndexer
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.@GuardedBy(value="external index read lock") public Index.Result reindexWorklogs(@Nonnull Collection<Worklog> worklogs, @Nonnull Context context, boolean shouldReplicate)
reindexWorklogs
in interface IssueIndexer
public Index.Result deindexComments(@Nonnull Collection<? extends WithId> comments, @Nonnull Context context, boolean shouldReplicate)
deindexComments
in interface IssueIndexer
public Index.Result deindexWorklogs(@Nonnull Collection<? extends WithId> worklogs, @Nonnull Context context, boolean shouldReplicate)
deindexWorklogs
in interface IssueIndexer
@GuardedBy(value="external index read lock") public Index.Result conditionalUpdateWithVersion(IndexDirectoryFactory.Name indexName, org.apache.lucene.document.Document document)
IssueIndexer
Document
conditionally based on the entity id and the version which are resolved by
IndexDirectoryFactory.Name.getEntityIdFromDocument(Document)
and
IndexDirectoryFactory.Name.getEntityVersionFromDocument(Document)
conditionalUpdateWithVersion
in interface IssueIndexer
indexName
- define the target indexdocument
- the document needs to be indexed@GuardedBy(value="external index read lock") public 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)
IssueIndexer
IndexDirectoryFactory.Name.getEntityIdFromDocument(Document)
and
IndexDirectoryFactory.Name.getEntityVersionFromDocument(Document)
conditionalUpdateWithVersion
in interface IssueIndexer
issueDocument
- issue document needs to be indexedcommentDocuments
- issue's comment documentschangeHistoryDocuments
- issue's history change documentsworklogDocuments
- issue's worklog documentspublic void deleteIndexes()
IssueIndexer
deleteIndexes
in interface IssueIndexer
public void deleteIndexes(@Nonnull IssueIndexingParams issueIndexingParams)
IssueIndexer
deleteIndexes
in interface IssueIndexer
issueIndexingParams
- parameters describing which indexes should be deleted.public UnmanagedIndexSearcher openEntitySearcher(IndexDirectoryFactory.Name index)
UnmanagedIndexSearcherProvider
DefaultIndexManager.indexLock
.
See DefaultIndexManager.getEntitySearcher(IndexDirectoryFactory.Name)
()}.openEntitySearcher
in interface UnmanagedIndexSearcherProvider
public Index.Result optimize()
optimize
in interface IssueIndexer
public void shutdown()
shutdown
in interface IssueIndexer
public List<String> getIndexPaths()
getIndexPaths
in interface IssueIndexer
public String getIndexRootPath()
getIndexRootPath
in interface IssueIndexer
public void contributeToBackup(BackupBuilder backupBuilder)
BackupContributor
backupBuilder
to include them in the backup being created when this method was called.contributeToBackup
in interface BackupContributor
backupBuilder
- builder of the backup being created at the time of call. All existing and nonempty files passed to its accept method will be included. The builder may not be reusable and the reference should not be stored outside the scope of this methodCopyright © 2002-2021 Atlassian. All Rights Reserved.