dcapwell commented on code in PR #4231:
URL: https://github.com/apache/cassandra/pull/4231#discussion_r2271413220


##########
src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:
##########
@@ -58,20 +60,38 @@
 import org.yaml.snakeyaml.representer.Representer;
 import org.yaml.snakeyaml.resolver.Resolver;
 
+import static 
org.apache.cassandra.config.CassandraRelevantEnv.CASSANDRA_ALLOW_CONFIG_ENVIRONMENT_VARIABLES;
 import static 
org.apache.cassandra.config.CassandraRelevantProperties.ALLOW_DUPLICATE_CONFIG_KEYS;
 import static 
org.apache.cassandra.config.CassandraRelevantProperties.ALLOW_NEW_OLD_CONFIG_KEYS;
 import static 
org.apache.cassandra.config.CassandraRelevantProperties.CASSANDRA_CONFIG;
+import static 
org.apache.cassandra.config.CassandraRelevantProperties.CONFIG_ALLOW_ENVIRONMENT_VARIABLES;
 import static org.apache.cassandra.config.Replacements.getNameReplacements;
 
 public class YamlConfigurationLoader implements ConfigurationLoader
 {
+    final static Set<String> OVERRIDABLE_CONFIG_NAMES;
+
+    static
+    {
+        // Configs can be overriden via system properties and environment 
variables entirely or partially
+        // For example: sai_options.prioritize_over_legacy_index=true or
+        //              sai_options: {prioritize_over_legacy_index=true, 
segment_write_buffer_size=100MiB}
+        Loader loader = Properties.defaultLoader();
+        Map<String, Property> topLevelConfigs = 
loader.getProperties(Config.class);
+        Map<String, Property> flattenedConfigs = loader.flatten(Config.class);
+        OVERRIDABLE_CONFIG_NAMES = 
Collections.unmodifiableSet(Sets.union(topLevelConfigs.keySet(), 
flattenedConfigs.keySet()));

Review Comment:
   i don't think this is correct still. 
   
   ```
   foo.bar.baz
   foo.bar
   foo
   ```
   
   In this case you have 3 possible values, but this only allows 2 (`foo` and 
`foo.bar.baz`). We can fork `flatten` in 
`org.apache.cassandra.config.Properties` to return all possible names, that 
would solve this issue



-- 
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: pr-unsubscr...@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to