Cyrill commented on code in PR #2386:
URL: https://github.com/apache/ignite-3/pull/2386#discussion_r1289980755


##########
modules/configuration/README.md:
##########
@@ -195,6 +202,38 @@ public static class DatetimeColumnConfigurationSchema 
extends ColumnConfiguratio
 Thus, a column can only be one of these (varchar, decimal and datetime) types 
and will contain the
 type, name and fields specific to it.
 
+### Configuration extension
+
+Allows to add properties into other configurations.
+
+Suppose we have a `security` module and want to add one more authentication 
component that is located 
+in a different module that depends on `security`.
+
+```java
+@ConfigurationRoot(rootName = "security", type = ConfigurationType.DISTRIBUTED)
+public class SecurityConfigurationSchema {
+    @ConfigValue
+    public AuthenticationConfigurationSchema authentication;
+}
+
+@Config
+public class AuthenticationConfigurationSchema {
+  @Value(hasDefault = true)
+  public final boolean enabled = false;
+}
+```
+
+What we need to do is to subclass the configuration we want to extend.
+
+```java
+@ConfigurationExtension
+public class UserSecurityConfigurationSchema extends 
SecurityConfigurationSchema {
+  @Value
+  public final String user;
+}
+```
+And the resulting configuration will look as if the field `user` was declared 
directly in `SecurityConfigurationSchema`.

Review Comment:
   added



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to