Package com.atlassian.jira.sharing.index
Class DefaultSharedEntityIndexer
java.lang.Object
com.atlassian.jira.sharing.index.DefaultSharedEntityIndexer
- All Implemented Interfaces:
SharedEntityIndexer
default implementation
- Since:
- v3.13
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Holds aDocument
and an identifyingTerm
so we can delete any pre-existing document.static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Index.Manager
used only when closing and shutting down so we don't create stray index directories -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSharedEntityIndexer
(ShareTypeFactory shareTypeFactory, SharedEntitySearchContextToQueryFactoryMap searchContextToQueryFactoryMap, SharedEntityAccessor.Factory accessorFactory, DirectoryFactory directoryFactory, UserManager userManager, ReplicatedIndexManager replicatedIndexManager, ApplicationProperties applicationProperties, IndexBackupContributionStrategy backupPreparationStrategy) -
Method Summary
Modifier and TypeMethodDescriptionclear
(SharedEntity.TypeDescriptor<?> type) Clear a particular type's index.void
contributeToSnapshot
(SharedEntity.TypeDescriptor<? extends SharedEntity> entityType, BackupBuilder backupBuilder) Contribute a set of files that represent shared entity index ofentityType
to the givenbackupBuilder
to include them in the backup being created when this method was called.deIndex
(SharedEntity entity) Delete a document from the index.deIndex
(Set<SharedEntity> sharedEntities, boolean shouldReplicate) Delete multiple documents in the indexindex
(SharedEntity entity) Add or update a document in the index.index
(SharedEntity entity, boolean shouldReplicate) Add or update a document in the index.index
(Set<SharedEntity> sharedEntities, boolean shouldReplicate) Add or update multiple documents in the indexlong
optimize
(SharedEntity.TypeDescriptor<?> type) Optimize a particular type's index.void
recreate
(SharedEntity.TypeDescriptor<?> type) Recreate the index.void
shutdown
(SharedEntity.TypeDescriptor<?> type) Shutdown a particular type's index.<S extends SharedEntity>
SharedEntitySearchResult<S>withSearcher
(SharedEntity.TypeDescriptor<S> type, Function<SharedEntitySearcher<S>, SharedEntitySearchResult<S>> searcherOperation)
-
Field Details
-
NULL_MANAGER
used only when closing and shutting down so we don't create stray index directories
-
-
Constructor Details
-
Method Details
-
index
Description copied from interface:SharedEntityIndexer
Add or update multiple documents in the index- Specified by:
index
in interfaceSharedEntityIndexer
- Parameters:
sharedEntities
- a Set of entities to add to the indexshouldReplicate
- whether or not the index changes should be replicated to the other nodes in the cluster.
-
deIndex
Description copied from interface:SharedEntityIndexer
Delete multiple documents in the index- Specified by:
deIndex
in interfaceSharedEntityIndexer
- Parameters:
sharedEntities
- a Set of entities to remove from the indexshouldReplicate
- whether or not the index changes should be replicated to the other nodes in the cluster.
-
getAllIndexPaths
- Specified by:
getAllIndexPaths
in interfaceSharedEntityIndexer
- Returns:
- all the paths where the indexes are