Package io.jmix.search.index.impl
Class BaseIndexManager<TState,TSettings,TJsonp>
java.lang.Object
io.jmix.search.index.impl.BaseIndexManager<TState,TSettings,TJsonp>
- All Implemented Interfaces:
IndexManager
- Direct Known Subclasses:
ElasticsearchIndexManager
,OpenSearchIndexManager
public abstract class BaseIndexManager<TState,TSettings,TJsonp>
extends Object
implements IndexManager
Contains non-platform-specific operations.
Interaction with indexes is performed in platform-specific implementations.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final IndexConfigurationComparator<TState,
TSettings, TJsonp> protected final IndexConfigurationManager
protected final IndexStateRegistry
protected final IndexStateResolver<TState,
TJsonp> protected final com.fasterxml.jackson.databind.ObjectMapper
protected final SearchProperties
-
Constructor Summary
ModifierConstructorDescriptionprotected
BaseIndexManager
(IndexConfigurationManager indexConfigurationManager, IndexStateRegistry indexStateRegistry, SearchProperties searchProperties, IndexConfigurationComparator<TState, TSettings, TJsonp> indexConfigurationComparator, IndexStateResolver<TState, TJsonp> indexStateResolver) -
Method Summary
Modifier and TypeMethodDescriptionprotected IndexSynchronizationStatus
handleMissingIndex
(IndexConfiguration indexConfiguration, IndexSchemaManagementStrategy strategy) boolean
recreateIndex
(IndexConfiguration indexConfiguration) Drops and creates search index using providedIndexConfiguration
.Drops and creates all search indexes.recreateIndexes
(Collection<IndexConfiguration> indexConfigurations) Drops and creates search indexes using provided collection ofIndexConfiguration
.protected IndexSynchronizationStatus
recreateIrrelevantIndex
(IndexConfiguration indexConfiguration, IndexSchemaManagementStrategy strategy) synchronizeIndexSchema
(IndexConfiguration indexConfiguration) Synchronizes schema of search index for providedIndexConfiguration
.protected IndexSynchronizationStatus
synchronizeIndexSchema
(IndexConfiguration indexConfiguration, IndexSchemaManagementStrategy strategy) Synchronizes schemas of all search indexes defined in application.synchronizeIndexSchemas
(Collection<IndexConfiguration> indexConfigurations) Synchronizes schemas of search indexes for provided collection ofIndexConfiguration
.protected IndexSynchronizationStatus
updateIndexConfiguration
(IndexConfiguration indexConfiguration, IndexSchemaManagementStrategy strategy, ConfigurationComparingResult result) validateIndex
(IndexConfiguration indexConfiguration) Validates current state of index schema.Validates current state of schema of all search indexes defined in application.validateIndexes
(Collection<IndexConfiguration> indexConfigurations) Validates current state of index schema related to provided collection ofIndexConfiguration
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.jmix.search.index.IndexManager
createIndex, dropIndex, getIndexMetadata, isIndexExist, putMapping
-
Field Details
-
indexConfigurationManager
-
indexStateRegistry
-
searchProperties
-
objectMapper
protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper -
indexConfigurationComparator
-
indexStateResolver
-
-
Constructor Details
-
BaseIndexManager
protected BaseIndexManager(IndexConfigurationManager indexConfigurationManager, IndexStateRegistry indexStateRegistry, SearchProperties searchProperties, IndexConfigurationComparator<TState, TSettings, TJsonp> indexConfigurationComparator, IndexStateResolver<TState, TJsonp> indexStateResolver)
-
-
Method Details
-
recreateIndexes
Description copied from interface:IndexManager
Drops and creates all search indexes.- Specified by:
recreateIndexes
in interfaceIndexManager
- Returns:
- Map with operation result per every index configuration
-
recreateIndexes
public Map<IndexConfiguration,Boolean> recreateIndexes(Collection<IndexConfiguration> indexConfigurations) Description copied from interface:IndexManager
Drops and creates search indexes using provided collection ofIndexConfiguration
.- Specified by:
recreateIndexes
in interfaceIndexManager
- Parameters:
indexConfigurations
- index configurations- Returns:
- Map with operation result per every index configuration
-
recreateIndex
Description copied from interface:IndexManager
Drops and creates search index using providedIndexConfiguration
.- Specified by:
recreateIndex
in interfaceIndexManager
- Parameters:
indexConfiguration
- index configuration- Returns:
- true if index was successfully recreated, false otherwise
-
validateIndexes
Description copied from interface:IndexManager
Validates current state of schema of all search indexes defined in application.- Specified by:
validateIndexes
in interfaceIndexManager
- Returns:
IndexValidationStatus
per eachIndexConfiguration
-
validateIndexes
public Map<IndexConfiguration,IndexValidationStatus> validateIndexes(Collection<IndexConfiguration> indexConfigurations) Description copied from interface:IndexManager
Validates current state of index schema related to provided collection ofIndexConfiguration
.- Specified by:
validateIndexes
in interfaceIndexManager
- Parameters:
indexConfigurations
- actual configurations- Returns:
IndexValidationStatus
per eachIndexConfiguration
-
validateIndex
Description copied from interface:IndexManager
Validates current state of index schema.- Specified by:
validateIndex
in interfaceIndexManager
- Parameters:
indexConfiguration
- actual configuration- Returns:
IndexValidationStatus
-
synchronizeIndexSchemas
Description copied from interface:IndexManager
Synchronizes schemas of all search indexes defined in application.- Specified by:
synchronizeIndexSchemas
in interfaceIndexManager
- Returns:
IndexSynchronizationStatus
per eachIndexConfiguration
-
synchronizeIndexSchemas
public Map<IndexConfiguration,IndexSynchronizationStatus> synchronizeIndexSchemas(Collection<IndexConfiguration> indexConfigurations) Description copied from interface:IndexManager
Synchronizes schemas of search indexes for provided collection ofIndexConfiguration
.- Specified by:
synchronizeIndexSchemas
in interfaceIndexManager
- Parameters:
indexConfigurations
- actual index configurations- Returns:
IndexSynchronizationStatus
per eachIndexConfiguration
-
synchronizeIndexSchema
Description copied from interface:IndexManager
Synchronizes schema of search index for providedIndexConfiguration
.It tries to update schema to the actual state according to
IndexSchemaManagementStrategy
defined by 'jmix.search.indexSchemaManagementStrategy' application property.- Specified by:
synchronizeIndexSchema
in interfaceIndexManager
- Parameters:
indexConfiguration
- actual index configuration- Returns:
IndexSynchronizationStatus
-
synchronizeIndexSchema
protected IndexSynchronizationStatus synchronizeIndexSchema(IndexConfiguration indexConfiguration, IndexSchemaManagementStrategy strategy) -
recreateIrrelevantIndex
protected IndexSynchronizationStatus recreateIrrelevantIndex(IndexConfiguration indexConfiguration, IndexSchemaManagementStrategy strategy) -
handleMissingIndex
protected IndexSynchronizationStatus handleMissingIndex(IndexConfiguration indexConfiguration, IndexSchemaManagementStrategy strategy) -
updateIndexConfiguration
protected IndexSynchronizationStatus updateIndexConfiguration(IndexConfiguration indexConfiguration, IndexSchemaManagementStrategy strategy, ConfigurationComparingResult result)
-