- All Known Implementing Classes:
DataTier.DefaultHotAllocationSettingProvider,IndexMode.IndexModeSettingsProvider
public interface IndexSettingProvider
An
IndexSettingProvider is a provider for index level settings and custom index metadata that can be set
explicitly as a default value (so they show up as "set" for newly created indices)-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordInfrastructure class that holds services that can be used byIndexSettingProviderinstances. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidonUpdateMappings(IndexMetadata indexMetadata, DocumentMapper documentMapper, Settings.Builder additionalSettings, BiConsumer<String, Map<String, String>> additionalCustomMetadata) Called when the mappings for an existing index are updated, before the new index metadata is created.default booleanIndicates whether the additional settings that this provider returns can overrule the settings defined in matching template or in create index request.voidprovideAdditionalMetadata(String indexName, String dataStreamName, IndexMode templateIndexMode, ProjectMetadata projectMetadata, Instant resolvedAt, Settings indexTemplateAndCreateRequestSettings, List<CompressedXContent> combinedTemplateMappings, Settings.Builder additionalSettings, BiConsumer<String, Map<String, String>> additionalCustomMetadata) Allows to provide default indexSettingsand custom index metadata for a newly created index.
-
Method Details
-
provideAdditionalMetadata
void provideAdditionalMetadata(String indexName, @Nullable String dataStreamName, @Nullable IndexMode templateIndexMode, ProjectMetadata projectMetadata, Instant resolvedAt, Settings indexTemplateAndCreateRequestSettings, List<CompressedXContent> combinedTemplateMappings, Settings.Builder additionalSettings, BiConsumer<String, Map<String, String>> additionalCustomMetadata) Allows to provide default indexSettingsand custom index metadata for a newly created index.- Parameters:
indexName- The name of the new index being createddataStreamName- The name of the data stream if the index being created is part of a data stream otherwisenulltemplateIndexMode- The index mode defined in template if template creates data streams, otherwisenullis returned.projectMetadata- The current project metadata instance that doesn't yet contain the index to be createdresolvedAt- The time the request to create this new index was accepted.indexTemplateAndCreateRequestSettings- All the settings resolved from the template that matches and any settings defined on the create index requestcombinedTemplateMappings- All the mappings resolved from the template that matchesadditionalSettings- A settings builder to which additional settings can be addedadditionalCustomMetadata- A consumer to which additional custom index metadata can be added
-
onUpdateMappings
default void onUpdateMappings(IndexMetadata indexMetadata, DocumentMapper documentMapper, Settings.Builder additionalSettings, BiConsumer<String, Map<String, String>> additionalCustomMetadata) Called when the mappings for an existing index are updated, before the new index metadata is created. This method can be used to update index settings and to provide custom metadata based on the new mappings.- Parameters:
indexMetadata- The index metadata for the index being updateddocumentMapper- The document mapper containing the updated mappingsadditionalSettings- A settings builder to which additional settings can be addedadditionalCustomMetadata- A consumer to which additional custom index metadata can be added
-
overrulesTemplateAndRequestSettings
default boolean overrulesTemplateAndRequestSettings()Indicates whether the additional settings that this provider returns can overrule the settings defined in matching template or in create index request. Note that this is not used during index template validation, to avoid overruling template settings that may apply to different contexts (e.g. the provider is not used, or it returns different setting values).
-