Class ElasticsearchIndexSchemaManager
java.lang.Object
org.hibernate.search.backend.elasticsearch.schema.management.impl.ElasticsearchIndexSchemaManager
- All Implemented Interfaces:
IndexSchemaManager
-
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchIndexSchemaManager(Optional<String> backendName, com.google.gson.Gson userFacingGson, ElasticsearchWorkFactory workFactory, ElasticsearchParallelWorkOrchestrator workOrchestrator, IndexLayoutStrategy indexLayoutStrategy, IndexNames indexNames, IndexMetadata expectedMetadata, ElasticsearchIndexLifecycleExecutionOptions executionOptions, ElasticsearchPropertyMappingValidatorProvider propertyMappingValidatorProvider) -
Method Summary
Modifier and TypeMethodDescriptioncreateIfMissing(OperationSubmitter operationSubmitter) Creates the schema if it doesn't already exist.createOrUpdate(OperationSubmitter operationSubmitter) Creates the schema if it doesn't already exist, or updates the existing schema to match requirements expressed by the mapper.createOrValidate(ContextualFailureCollector failureCollector, OperationSubmitter operationSubmitter) Creates the schema if it doesn't already exist, or validates the existing schema against requirements expressed by the mapper.dropAndCreate(OperationSubmitter operationSubmitter) Drops the schema and all indexed data if it exists, then creates the schema.dropIfExisting(OperationSubmitter operationSubmitter) Drops the schema and all indexed data if it exists.voidexportExpectedSchema(IndexSchemaCollector collector) Accepts a collector that will receive the schema export represented by this index schema manager.validate(ContextualFailureCollector failureCollector, OperationSubmitter operationSubmitter) Validates the existing schema against requirements expressed by the mapper.
-
Constructor Details
-
ElasticsearchIndexSchemaManager
public ElasticsearchIndexSchemaManager(Optional<String> backendName, com.google.gson.Gson userFacingGson, ElasticsearchWorkFactory workFactory, ElasticsearchParallelWorkOrchestrator workOrchestrator, IndexLayoutStrategy indexLayoutStrategy, IndexNames indexNames, IndexMetadata expectedMetadata, ElasticsearchIndexLifecycleExecutionOptions executionOptions, ElasticsearchPropertyMappingValidatorProvider propertyMappingValidatorProvider)
-
-
Method Details
-
createIfMissing
Description copied from interface:IndexSchemaManagerCreates the schema if it doesn't already exist.Does not change or validate anything if the schema already exists.
- Specified by:
createIfMissingin interfaceIndexSchemaManager- Parameters:
operationSubmitter- How to handle request to submit operation when the queue is full.- Returns:
- A future.
-
createOrValidate
public CompletableFuture<?> createOrValidate(ContextualFailureCollector failureCollector, OperationSubmitter operationSubmitter) Description copied from interface:IndexSchemaManagerCreates the schema if it doesn't already exist, or validates the existing schema against requirements expressed by the mapper.If the schema exists and validation happens, validation failures do not trigger an exception, but instead are pushed to the given collector.
- Specified by:
createOrValidatein interfaceIndexSchemaManager- Parameters:
failureCollector- A collector for validation failures.operationSubmitter- How to handle request to submit operation when the queue is full.- Returns:
- A future.
-
createOrUpdate
Description copied from interface:IndexSchemaManagerCreates the schema if it doesn't already exist, or updates the existing schema to match requirements expressed by the mapper.Updating the schema may be impossible (for example if the type of a field changed). In this case, the future will ultimately be completed with a
SearchException.- Specified by:
createOrUpdatein interfaceIndexSchemaManager- Parameters:
operationSubmitter- How to handle request to submit operation when the queue is full.- Returns:
- A future.
-
dropIfExisting
Description copied from interface:IndexSchemaManagerDrops the schema and all indexed data if it exists.Does not change anything if the schema does not exist.
- Specified by:
dropIfExistingin interfaceIndexSchemaManager- Parameters:
operationSubmitter- How to handle request to submit operation when the queue is full.- Returns:
- A future.
-
dropAndCreate
Description copied from interface:IndexSchemaManagerDrops the schema and all indexed data if it exists, then creates the schema.- Specified by:
dropAndCreatein interfaceIndexSchemaManager- Parameters:
operationSubmitter- How to handle request to submit operation when the queue is full.- Returns:
- A future.
-
validate
public CompletableFuture<?> validate(ContextualFailureCollector failureCollector, OperationSubmitter operationSubmitter) Description copied from interface:IndexSchemaManagerValidates the existing schema against requirements expressed by the mapper.If the schema does not exist, a failure is pushed to the given collector.
If the index exists and validation happens, validation failures do not trigger an exception, but instead are pushed to the given collector.
- Specified by:
validatein interfaceIndexSchemaManager- Parameters:
failureCollector- A collector for validation failures.operationSubmitter- How to handle request to submit operation when the queue is full.- Returns:
- A future.
-
exportExpectedSchema
Description copied from interface:IndexSchemaManagerAccepts a collector that will receive the schema export represented by this index schema manager.- Specified by:
exportExpectedSchemain interfaceIndexSchemaManager
-