Interface ConfigurationModule
- All Known Implementing Classes:
ClientHandlerConfigurationModule
Each configuration module only supplies configuration of only one ConfigurationType, so,
if a library needs to provide both node-local and cluster-wide configuration, it needs to supply
two ConfigurationModule instances.
Designed for integration with ServiceLoader mechanism, so ConfigurationModule instances
provided by a library are to be defined as services either in
META-INF/services/org.apache.ignite.configuration.ConfigurationModule, or in a module-info.java.
Supplies the following configuration components:
- rootKeys (
RootKeyinstances) - validators (
Validatorinstances) - schemaExtensions (classes annotated with
ConfigurationExtension) - polymorphicSchemaExtensions (classes annotated with
PolymorphicConfig)
-
Method Summary
Modifier and TypeMethodDescriptiondefault Collection<String>Returns a collection of prefixes, removed from configuration.default voidmigrateDeprecatedConfigurations(SuperRootChange superRootChange) Logic to perform configuration migration when Ignite version is upgraded.default voidpatchConfigurationWithDynamicDefaults(SuperRootChange rootChange) Patches the provided configuration with dynamic default values.default Collection<Class<?>>Returns classes of polymorphic schema extensions (annotated withPolymorphicConfig) provided by this module.default Collection<RootKey<?,?, ?>> rootKeys()Returns keys of configuration roots provided by this module.default Collection<Class<?>>Returns classes of schema extensions (annotated withConfigurationExtension) provided by this module, including internal extensions.type()Type of the configuration provided by this module.Returns configuration validators provided by this module.
-
Method Details
-
type
ConfigurationType type()Type of the configuration provided by this module.- Returns:
- configuration type
-
rootKeys
Returns keys of configuration roots provided by this module.- Returns:
- root keys
-
validators
Returns configuration validators provided by this module.- Returns:
- configuration validators
-
schemaExtensions
Returns classes of schema extensions (annotated withConfigurationExtension) provided by this module, including internal extensions. -
polymorphicSchemaExtensions
Returns classes of polymorphic schema extensions (annotated withPolymorphicConfig) provided by this module.- Returns:
- polymorphic schema extensions' classes
-
patchConfigurationWithDynamicDefaults
Patches the provided configuration with dynamic default values. This method is called- for cluster-wide configuration on cluster initialization.
- for node-local configuration on the node start during the process of local configs reading.
Dynamic defaults are default values that are not specified in the configuration source, but are added to the configuration on-the-fly, based on some external conditions.
For example, if the configuration contains a list of caches, and the user specifies a list of caches in the source, then the defaults for the caches are not applied. But if the user does not specify a list of caches, then the configuration module may add a cache to the list based on some external conditions.
The default implementation of this method is a no-op.
- Parameters:
rootChange- Root change.
-
migrateDeprecatedConfigurations
Logic to perform configuration migration when Ignite version is upgraded. Main task - replace deprecated configuration values with their non-deprecated cousins.Typical implementation should look something like this:
var barValue = superRoot.viewRoot(KEY).foo().oldConfiguration().bar() if (barValue != BAR_DEFAULT) { // Usually implies explicitly set value. superRoot.changeRoot(KEY).changeNewFoo().changeBar(barValue) }- Parameters:
superRootChange- Super root change instance.
-
deletedPrefixes
Returns a collection of prefixes, removed from configuration. Keys that match any of the prefixes in this collection will be deleted.Use
ignite.my.deleted.propertyfor regular deleted propertiesignite.list.*.deletedProperty- for named list elements. Arbitrarily nested named lists are supported- Returns:
- A collection of prefixes of deleted keys.
-