dcapwell commented on a change in pull request #1335:
URL: https://github.com/apache/cassandra/pull/1335#discussion_r808405471



##########
File path: src/java/org/apache/cassandra/config/DefaultLoader.java
##########
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.config;
+
+import java.beans.IntrospectionException;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.yaml.snakeyaml.error.YAMLException;
+import org.yaml.snakeyaml.introspector.FieldProperty;
+import org.yaml.snakeyaml.introspector.MethodProperty;
+import org.yaml.snakeyaml.introspector.Property;
+
+import static org.apache.cassandra.utils.FBUtilities.camelToSnake;
+
+public class DefaultLoader implements Loader

Review comment:
       >  what about properties which are final
   
   `final` only comes into play at the write time (aka yaml or 
system_views.settings), as long as the field is public it is a "property" as 
defined by SnakeYAML (it currently ignores final and makes everything 
accessible).  For the loader logic, we want to return it as it is `get`able, 
though I feel its fair to ask if we should allow write (aka block in yaml and 
writing via system_views.settings); ATM we match SnakeYAML and allow mutation.
   
   This can be seen as confusing though the only cases that matter in Config 
today are the POJO types in Config (stuff like TrackWarnings).  We will need to 
keep the properties as they are critical for nesting (`track_warnings` is final 
but `track_warnings.enabled` is not), but may choose to filter them in 
`system_views.settings` if we like




-- 
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