public class DefaultSharedEntityIndexer extends Object implements SharedEntityIndexer
Modifier and Type | Class and Description |
---|---|
static interface |
DefaultSharedEntityIndexer.EntityDocument
Holds a
Document and an identifying Term so we can delete any pre-existing document. |
static interface |
DefaultSharedEntityIndexer.EntityDocumentFactory |
Modifier and Type | Field and Description |
---|---|
static Index.Manager |
NULL_MANAGER
used only when closing and shutting down so we don't create stray index directories
|
Constructor and Description |
---|
DefaultSharedEntityIndexer(ShareTypeFactory shareTypeFactory,
SharedEntitySearchContextToQueryFactoryMap searchContextToQueryFactoryMap,
SharedEntityAccessor.Factory accessorFactory,
DirectoryFactory directoryFactory,
UserManager userManager,
ReplicatedIndexManager replicatedIndexManager,
ApplicationProperties applicationProperties,
IndexBackupContributionStrategy backupPreparationStrategy) |
Modifier and Type | Method and Description |
---|---|
String |
clear(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 of
entityType to the given backupBuilder to include them in the backup being created when this method was called. |
Index.Result |
deIndex(Set<SharedEntity> sharedEntities,
boolean shouldReplicate)
Delete multiple documents in the index
|
Index.Result |
deIndex(SharedEntity entity)
Delete a document from the index.
|
Collection<String> |
getAllIndexPaths() |
Index.Result |
index(Set<SharedEntity> sharedEntities,
boolean shouldReplicate)
Add or update multiple documents in the index
|
Index.Result |
index(SharedEntity entity)
Add or update a document in the index.
|
Index.Result |
index(SharedEntity entity,
boolean shouldReplicate)
Add or update a document in the index.
|
long |
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> |
withSearcher(SharedEntity.TypeDescriptor<S> type,
java.util.function.Function<SharedEntitySearcher<S>,SharedEntitySearchResult<S>> searcherOperation) |
public static final Index.Manager NULL_MANAGER
public DefaultSharedEntityIndexer(ShareTypeFactory shareTypeFactory, SharedEntitySearchContextToQueryFactoryMap searchContextToQueryFactoryMap, SharedEntityAccessor.Factory accessorFactory, DirectoryFactory directoryFactory, UserManager userManager, ReplicatedIndexManager replicatedIndexManager, ApplicationProperties applicationProperties, IndexBackupContributionStrategy backupPreparationStrategy)
public Index.Result index(SharedEntity entity)
SharedEntityIndexer
index
in interface SharedEntityIndexer
entity
- the entity to add to the indexpublic Index.Result deIndex(SharedEntity entity)
SharedEntityIndexer
deIndex
in interface SharedEntityIndexer
entity
- the entity to remove from the indexpublic Index.Result index(SharedEntity entity, boolean shouldReplicate)
SharedEntityIndexer
index
in interface SharedEntityIndexer
entity
- the entity to add to the indexshouldReplicate
- whether or not the index changes should be replicated to the other nodes in the cluster.public Index.Result index(Set<SharedEntity> sharedEntities, boolean shouldReplicate)
SharedEntityIndexer
index
in interface SharedEntityIndexer
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.public Index.Result deIndex(Set<SharedEntity> sharedEntities, boolean shouldReplicate)
SharedEntityIndexer
deIndex
in interface SharedEntityIndexer
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.public <S extends SharedEntity> SharedEntitySearchResult<S> withSearcher(SharedEntity.TypeDescriptor<S> type, java.util.function.Function<SharedEntitySearcher<S>,SharedEntitySearchResult<S>> searcherOperation)
withSearcher
in interface SharedEntityIndexer
public long optimize(SharedEntity.TypeDescriptor<?> type)
SharedEntityIndexer
optimize
in interface SharedEntityIndexer
type
- describes the particular indexpublic String clear(SharedEntity.TypeDescriptor<?> type)
SharedEntityIndexer
clear
in interface SharedEntityIndexer
type
- describes the particular indexpublic void recreate(SharedEntity.TypeDescriptor<?> type)
SharedEntityIndexer
recreate
in interface SharedEntityIndexer
public void contributeToSnapshot(SharedEntity.TypeDescriptor<? extends SharedEntity> entityType, BackupBuilder backupBuilder)
SharedEntityIndexer
entityType
to the given backupBuilder
to include them in the backup being created when this method was called.contributeToSnapshot
in interface SharedEntityIndexer
entityType
- type of SharedEntity
index to be added to the snapshotbackupBuilder
- temporary(reference should not be stored) builder of backup file. All existing and nonempty files passed to it's accept method will be included in archive being created during the call.public void shutdown(SharedEntity.TypeDescriptor<?> type)
SharedEntityIndexer
shutdown
in interface SharedEntityIndexer
type
- describes the particular indexpublic Collection<String> getAllIndexPaths()
getAllIndexPaths
in interface SharedEntityIndexer
Copyright © 2002-2021 Atlassian. All Rights Reserved.