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)
SharedEntityIndexerindex in interface SharedEntityIndexerentity - the entity to add to the indexpublic Index.Result deIndex(SharedEntity entity)
SharedEntityIndexerdeIndex in interface SharedEntityIndexerentity - the entity to remove from the indexpublic Index.Result index(SharedEntity entity, boolean shouldReplicate)
SharedEntityIndexerindex in interface SharedEntityIndexerentity - 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)
SharedEntityIndexerindex in interface SharedEntityIndexersharedEntities - 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)
SharedEntityIndexerdeIndex in interface SharedEntityIndexersharedEntities - 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 SharedEntityIndexerpublic long optimize(SharedEntity.TypeDescriptor<?> type)
SharedEntityIndexeroptimize in interface SharedEntityIndexertype - describes the particular indexpublic String clear(SharedEntity.TypeDescriptor<?> type)
SharedEntityIndexerclear in interface SharedEntityIndexertype - describes the particular indexpublic void recreate(SharedEntity.TypeDescriptor<?> type)
SharedEntityIndexerrecreate in interface SharedEntityIndexerpublic void contributeToSnapshot(SharedEntity.TypeDescriptor<? extends SharedEntity> entityType, BackupBuilder backupBuilder)
SharedEntityIndexerentityType to the given backupBuilder to include them in the backup being created when this method was called.contributeToSnapshot in interface SharedEntityIndexerentityType - 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)
SharedEntityIndexershutdown in interface SharedEntityIndexertype - describes the particular indexpublic Collection<String> getAllIndexPaths()
getAllIndexPaths in interface SharedEntityIndexerCopyright © 2002-2024 Atlassian. All Rights Reserved.