Kirill Tkalenko created IGNITE-17148:
----------------------------------------
Summary: Support for abstract configuration
Key: IGNITE-17148
URL: https://issues.apache.org/jira/browse/IGNITE-17148
Project: Ignite
Issue Type: Task
Reporter: Kirill Tkalenko
Assignee: Kirill Tkalenko
Fix For: 3.0.0-alpha6
*NOTE*
Description may not be complete.
*Problem*
We need the ability to create a basic configuration schema so that we can
define a common configuration schema and inherit from it with additional
configuration added.
Let's look at an example:
We need to create two configuration schemes for the Memory based storage
engine, they should have a common property "page size in bytes" and then they
should be different, let's sketch an example scheme.
{code:java}
public class BasePageMemoryStorageEngineConfigurationSchema {
@Value(hasDefault = true)
public int pageSize = 16 * 1024;
}
public class VolatilePageMemoryStorageEngineConfigurationSchema extends
BasePageMemoryStorageEngineConfigurationSchema{
@ConfigValue
public VolatilePageMemoryDataRegionConfigurationSchema defaultRegion;
@NamedConfigValue
public VolatilePageMemoryDataRegionConfigurationSchema regions;
}
public class PersistentPageMemoryStorageEngineConfigurationSchema extends
BasePageMemoryStorageEngineConfigurationSchema{
@ConfigValue
public PersistentPageMemoryDataRegionConfigurationSchema defaultRegion;
@NamedConfigValue
public PersistentPageMemoryDataRegionConfigurationSchema regions;
@ConfigValue
public PageMemoryCheckpointConfigurationSchema checkpoint;
}{code}
How can we implement this at the moment:
* [internal extension of the
configuration|https://issues.apache.org/jira/browse/IGNITE-15047]: then the
user will not be able to see and change it - not suitable;
* [polymorphic
configuration|https://issues.apache.org/jira/browse/IGNITE-14645]:
** by design, we cannot create root config schemas for polymorphic config or
instances;
** by design, we can change the type of polymorphic configuration to any
instance, we do not fix its type, which does not suit us;
** by design, we cannot expose a polymorphic instance as a configuration
schema property;
** hocon will display the type of polymorphic configuration, which is not
necessary in this case and will look a little strange.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)