Mmuzaf commented on code in PR #2133:
URL: https://github.com/apache/cassandra/pull/2133#discussion_r1149853885


##########
src/java/org/apache/cassandra/db/virtual/SettingsTable.java:
##########
@@ -157,4 +174,85 @@ private static Map<String, String> 
getBackwardsCompatableNames()
 
         return names;
     }
+
+    /**
+     * This class is used to provide backwards compatable support for the 
settings table in case the {@link Config}
+     * metadata changes. This class will provide the old names for the 
properties, but will use the new name to
+     * get the value from the {@link Config} object.
+     * <p>
+     * Updating a configuration property object will throw an exception if you 
will try to update a deprecated property.
+     */
+    private static class BackwardsCompatableRegistry implements Registry

Review Comment:
   There are a few reasons under the hood to move away from the 
`ForwardingProperty` logic for the `SettingsTable`:
   - The design assumes that we have a central point of access to the `Config' 
instance - the `ConfigurationRegistry' - to perform mutate configuration 
operations, ensuring that they are changed in the same way for each public 
interface;
   - We want to restrict the places where the `Config' instance is accessed - 
the `DatabaseDescriptor' and the `ConfigurationRegistry' are enough to force 
the `SettingsTable` to do what it needs to do;
   - the `Replacement` provides us with the name and type conversions for 
properties and as there are no usages of the old names in the source code we 
are able to perform name conversions for the `SettingsTable` needs;
   
   Maybe I'm missing something, but I see the following access path as more 
verbose than giving short cuts from the `SettingsTable' directly to the 
`Config':
   Config -> DatabaseDescription -> ConfigurationRegistry -> 
ReplacementRegistry -> SettingsTable;
   
   
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to