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
FieldsModifier and TypeFieldDescriptionprotected final IndexConfigurationComparator<TState,TSettings, TJsonp> protected final IndexConfigurationManagerprotected final IndexStateRegistryprotected final IndexStateResolver<TState,TJsonp> protected final com.fasterxml.jackson.databind.ObjectMapperprotected final SearchProperties -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseIndexManager(IndexConfigurationManager indexConfigurationManager, IndexStateRegistry indexStateRegistry, SearchProperties searchProperties, IndexConfigurationComparator<TState, TSettings, TJsonp> indexConfigurationComparator, IndexStateResolver<TState, TJsonp> indexStateResolver) -
Method Summary
Modifier and TypeMethodDescriptionprotected IndexValidationStatusgetIndexValidationStatus(IndexConfiguration indexConfiguration, boolean indexExist) protected IndexSynchronizationStatushandleMissingIndex(IndexConfiguration indexConfiguration, IndexSchemaManagementStrategy strategy) protected abstract booleanputMapping(String indexName, IndexMappingConfiguration mapping) booleanrecreateIndex(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 IndexSynchronizationStatusrecreateIrrelevantIndex(IndexConfiguration indexConfiguration, IndexSchemaManagementStrategy strategy) synchronizeIndexSchema(IndexConfiguration indexConfiguration) Synchronizes schema of search index for providedIndexConfiguration.protected IndexSynchronizationStatussynchronizeIndexSchema(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 IndexSynchronizationStatusupdateIndexConfiguration(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, waitMethods inherited from interface io.jmix.search.index.IndexManager
createIndex, dropIndex, getIndexMetadata, isIndexExist
-
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:IndexManagerDrops and creates all search indexes.- Specified by:
recreateIndexesin interfaceIndexManager- Returns:
- Map with operation result per every index configuration
-
recreateIndexes
public Map<IndexConfiguration,Boolean> recreateIndexes(Collection<IndexConfiguration> indexConfigurations) Description copied from interface:IndexManagerDrops and creates search indexes using provided collection ofIndexConfiguration.- Specified by:
recreateIndexesin interfaceIndexManager- Parameters:
indexConfigurations- index configurations- Returns:
- Map with operation result per every index configuration
-
recreateIndex
Description copied from interface:IndexManagerDrops and creates search index using providedIndexConfiguration.- Specified by:
recreateIndexin interfaceIndexManager- Parameters:
indexConfiguration- index configuration- Returns:
- true if index was successfully recreated, false otherwise
-
validateIndexes
Description copied from interface:IndexManagerValidates current state of schema of all search indexes defined in application.- Specified by:
validateIndexesin interfaceIndexManager- Returns:
IndexValidationStatusper eachIndexConfiguration
-
validateIndexes
public Map<IndexConfiguration,IndexValidationStatus> validateIndexes(Collection<IndexConfiguration> indexConfigurations) Description copied from interface:IndexManagerValidates current state of index schema related to provided collection ofIndexConfiguration.- Specified by:
validateIndexesin interfaceIndexManager- Parameters:
indexConfigurations- actual configurations- Returns:
IndexValidationStatusper eachIndexConfiguration
-
validateIndex
Description copied from interface:IndexManagerValidates current state of index schema.- Specified by:
validateIndexin interfaceIndexManager- Parameters:
indexConfiguration- actual configuration- Returns:
IndexValidationStatus
-
getIndexValidationStatus
protected IndexValidationStatus getIndexValidationStatus(IndexConfiguration indexConfiguration, boolean indexExist) -
synchronizeIndexSchemas
Description copied from interface:IndexManagerSynchronizes schemas of all search indexes defined in application.- Specified by:
synchronizeIndexSchemasin interfaceIndexManager- Returns:
IndexSynchronizationStatusper eachIndexConfiguration
-
synchronizeIndexSchemas
public Map<IndexConfiguration,IndexSynchronizationStatus> synchronizeIndexSchemas(Collection<IndexConfiguration> indexConfigurations) Description copied from interface:IndexManagerSynchronizes schemas of search indexes for provided collection ofIndexConfiguration.- Specified by:
synchronizeIndexSchemasin interfaceIndexManager- Parameters:
indexConfigurations- actual index configurations- Returns:
IndexSynchronizationStatusper eachIndexConfiguration
-
synchronizeIndexSchema
Description copied from interface:IndexManagerSynchronizes schema of search index for providedIndexConfiguration.It tries to update schema to the actual state according to
IndexSchemaManagementStrategydefined by 'jmix.search.indexSchemaManagementStrategy' application property.- Specified by:
synchronizeIndexSchemain 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) -
putMapping
-